diff options
author | 2017-03-08 11:54:56 +0530 | |
---|---|---|
committer | 2017-03-08 11:54:56 +0530 | |
commit | 80b299e8c4f290e3b16f35eea922cac989b6e767 (patch) | |
tree | b99086734507728ae096349cca4d0258335dbf4f /vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/showHide/showHide.js | |
parent | 5fa92b4eb456b5f4959c39578a3c6e3555c4ae7d (diff) |
VnfMarket place refactor
IssueId : CLIENT-4
Change-Id: Ia1b076400f9c3bedf9db714099a608ece392aa59
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/showHide/showHide.js')
-rw-r--r-- | vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/showHide/showHide.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/showHide/showHide.js b/vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/showHide/showHide.js new file mode 100644 index 00000000..83527421 --- /dev/null +++ b/vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/showHide/showHide.js @@ -0,0 +1,59 @@ +/*! + * Angular Material Design + * https://github.com/angular/material + * @license MIT + * v1.1.3 + */ +(function( window, angular, undefined ){ +"use strict"; + +/** + * @ngdoc module + * @name material.components.showHide + */ + +// Add additional handlers to ng-show and ng-hide that notify directives +// contained within that they should recompute their size. +// These run in addition to Angular's built-in ng-hide and ng-show directives. +angular.module('material.components.showHide', [ + 'material.core' +]) + .directive('ngShow', createDirective('ngShow', true)) + .directive('ngHide', createDirective('ngHide', false)); + + +function createDirective(name, targetValue) { + return ['$mdUtil', '$window', function($mdUtil, $window) { + return { + restrict: 'A', + multiElement: true, + link: function($scope, $element, $attr) { + var unregister = $scope.$on('$md-resize-enable', function() { + unregister(); + + var node = $element[0]; + var cachedTransitionStyles = node.nodeType === $window.Node.ELEMENT_NODE ? + $window.getComputedStyle(node) : {}; + + $scope.$watch($attr[name], function(value) { + if (!!value === targetValue) { + $mdUtil.nextTick(function() { + $scope.$broadcast('$md-resize'); + }); + + var opts = { + cachedTransitionStyles: cachedTransitionStyles + }; + + $mdUtil.dom.animator.waitTransitionEnd($element, opts).then(function() { + $scope.$broadcast('$md-resize'); + }); + } + }); + }); + } + }; + }]; +} + +})(window, window.angular);
\ No newline at end of file |