Notify the tree when the container was probably resized.
This commit is contained in:
parent
898210065e
commit
7c289beba5
4 changed files with 32 additions and 1 deletions
|
@ -117,6 +117,23 @@ quayApp = angular.module('quay', ['restangular', 'angularMoment', 'angulartics',
|
|||
}
|
||||
};
|
||||
}).
|
||||
directive('onresize', function ($window, $parse) {
|
||||
return function (scope, element, attr) {
|
||||
var fn = $parse(attr.onresize);
|
||||
|
||||
var notifyResized = function() {
|
||||
scope.$apply(function () {
|
||||
fn(scope);
|
||||
});
|
||||
};
|
||||
|
||||
angular.element($window).on('resize', null, notifyResized);
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
angular.element($window).off('resize', null, notifyResized);
|
||||
});
|
||||
};
|
||||
}).
|
||||
config(['$routeProvider', '$locationProvider', '$analyticsProvider',
|
||||
function($routeProvider, $locationProvider, $analyticsProvider) {
|
||||
|
||||
|
|
Reference in a new issue