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/whiteframe/whiteframe.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/whiteframe/whiteframe.js')
-rw-r--r-- | vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/whiteframe/whiteframe.js | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/whiteframe/whiteframe.js b/vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/whiteframe/whiteframe.js new file mode 100644 index 00000000..edd28309 --- /dev/null +++ b/vnfmarket/src/main/webapp/common/thirdparty/angular-material/modules/js/whiteframe/whiteframe.js @@ -0,0 +1,82 @@ +/*! + * Angular Material Design + * https://github.com/angular/material + * @license MIT + * v1.1.3 + */ +(function( window, angular, undefined ){ +"use strict"; + +/** + * @ngdoc module + * @name material.components.whiteframe + */ +MdWhiteframeDirective['$inject'] = ["$log"]; +angular + .module('material.components.whiteframe', ['material.core']) + .directive('mdWhiteframe', MdWhiteframeDirective); + +/** + * @ngdoc directive + * @module material.components.whiteframe + * @name mdWhiteframe + * + * @description + * The md-whiteframe directive allows you to apply an elevation shadow to an element. + * + * The attribute values needs to be a number between 1 and 24 or -1. + * When set to -1 no style is applied. + * + * ### Notes + * - If there is no value specified it defaults to 4dp. + * - If the value is not valid it defaults to 4dp. + + * @usage + * <hljs lang="html"> + * <div md-whiteframe="3"> + * <span>Elevation of 3dp</span> + * </div> + * </hljs> + * + * <hljs lang="html"> + * <div md-whiteframe="-1"> + * <span>No elevation shadow applied</span> + * </div> + * </hljs> + * + * <hljs lang="html"> + * <div ng-init="elevation = 5" md-whiteframe="{{elevation}}"> + * <span>Elevation of 5dp with an interpolated value</span> + * </div> + * </hljs> + */ +function MdWhiteframeDirective($log) { + var DISABLE_DP = -1; + var MIN_DP = 1; + var MAX_DP = 24; + var DEFAULT_DP = 4; + + return { + link: postLink + }; + + function postLink(scope, element, attr) { + var oldClass = ''; + + attr.$observe('mdWhiteframe', function(elevation) { + elevation = parseInt(elevation, 10) || DEFAULT_DP; + + if (elevation != DISABLE_DP && (elevation > MAX_DP || elevation < MIN_DP)) { + $log.warn('md-whiteframe attribute value is invalid. It should be a number between ' + MIN_DP + ' and ' + MAX_DP, element[0]); + elevation = DEFAULT_DP; + } + + var newClass = elevation == DISABLE_DP ? '' : 'md-whiteframe-' + elevation + 'dp'; + attr.$updateClass(newClass, oldClass); + oldClass = newClass; + }); + } +} + + +})(window, window.angular);
\ No newline at end of file |