Fix CPU issues by removing constant digesting. We do so by:
- Fixing the title and description (meta) to only respond to a rootScope watch, rather than using a timer - Change the tabs listening code to be completely self contained
This commit is contained in:
parent
d4b593cada
commit
31389b9974
5 changed files with 151 additions and 169 deletions
|
@ -243,7 +243,7 @@ angular.module("core-ui", [])
|
|||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {},
|
||||
controller: function($rootScope, $scope, $element, $timeout) {
|
||||
controller: function($rootScope, $scope, $element, $timeout, $location, UIService) {
|
||||
$scope.isClosed = true;
|
||||
|
||||
$scope.toggleClosed = function(e) {
|
||||
|
@ -252,13 +252,9 @@ angular.module("core-ui", [])
|
|||
e.preventDefault();
|
||||
};
|
||||
|
||||
// Add a listener to auto-close the tabs when a new tab is clicked.
|
||||
$timeout(function() {
|
||||
var tabs = $element.find('a[data-toggle="tab"]');
|
||||
tabs.on('shown.bs.tab', function (e) {
|
||||
$scope.isClosed = true;
|
||||
});
|
||||
}, 100);
|
||||
UIService.initializeTabs($scope, $element, function() {
|
||||
$scope.isClosed = true;
|
||||
});
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
|
|
Reference in a new issue