fixes slow UI by restricting angular animations to only work on elements with the umb-animated css class

This commit is contained in:
Mads Rasmussen
2018-06-14 13:48:51 +02:00
parent 913364b2c7
commit 383d5527bb
2 changed files with 13 additions and 1 deletions

View File

@@ -16,6 +16,18 @@ var app = angular.module('umbraco', [
'LocalStorageModule'
]);
// I configure the $animate service during bootstrap.
angular.module("umbraco").config(
function configureAnimate( $animateProvider ) {
// By default, the $animate service will check for animation styling
// on every structural change. This requires a lot of animateFrame-based
// DOM-inspection. However, we can tell $animate to only check for
// animations on elements that have a specific class name RegExp pattern
// present. In this case, we are requiring the "umb-animated" class.
$animateProvider.classNameFilter( /\bumb-animated\b/ );
}
);
var packages = angular.module("umbraco.packages", []);
//this ensures we can inject our own views into templateCache and clear

View File

@@ -1 +1 @@
<div class="umb-overlay-backdrop animate" ng-if="numberOfOverlays > 0"></div>
<div class="umb-overlay-backdrop animate umb-animated" ng-if="numberOfOverlays > 0"></div>