7 lines
9.9 KiB
JavaScript
7 lines
9.9 KiB
JavaScript
|
|
/*!
|
||
|
|
* AngularJS Material Design
|
||
|
|
* https://github.com/angular/material
|
||
|
|
* @license MIT
|
||
|
|
* v1.1.18-master-97a1616
|
||
|
|
*/
|
||
|
|
function MdDialogDirective(e,t,i){return{restrict:"E",link:function(o,a){a.addClass("_md"),t(a),e(function(){var e,t=a[0].querySelector("md-dialog-content");function n(){a.toggleClass("md-content-overflow",t.scrollHeight>t.clientHeight)}t&&(e=t.getElementsByTagName("img"),n(),angular.element(e).on("load",n)),o.$on("$destroy",function(){i.destroy(a)})})}}}function MdDialogProvider(e){var b,$;return n.$inject=["$mdDialog","$mdConstant"],o.$inject=["$mdDialog","$mdAria","$mdUtil","$mdConstant","$animate","$document","$window","$rootElement","$log","$injector","$mdTheming","$interpolate","$mdInteraction"],e("$mdDialog").setDefaults({methods:["disableParentScroll","hasBackdrop","clickOutsideToClose","escapeToClose","targetEvent","closeTo","openFrom","parent","fullscreen","multiple"],options:o}).addPreset("alert",{methods:["title","htmlContent","textContent","content","ariaLabel","ok","theme","css"],options:t}).addPreset("confirm",{methods:["title","htmlContent","textContent","content","ariaLabel","ok","cancel","theme","css"],options:t}).addPreset("prompt",{methods:["title","htmlContent","textContent","initialValue","content","placeholder","ariaLabel","ok","cancel","theme","css","required"],options:t});function t(){return{template:['<md-dialog md-theme="{{ dialog.theme || dialog.defaultTheme }}" aria-label="{{ dialog.ariaLabel }}" ng-class="dialog.css">',' <md-dialog-content class="md-dialog-content" role="document" tabIndex="-1">',' <h2 class="md-title">{{ dialog.title }}</h2>',' <div ng-if="::dialog.mdHtmlContent" class="md-dialog-content-body" ',' ng-bind-html="::dialog.mdHtmlContent"></div>',' <div ng-if="::!dialog.mdHtmlContent" class="md-dialog-content-body">'," <p>{{::dialog.mdTextContent}}</p>"," </div>",' <md-input-container md-no-float ng-if="::dialog.$type == \'prompt\'" class="md-prompt-input-container">',' <input ng-keypress="dialog.keypress($event)" md-autofocus ng-model="dialog.result" placeholder="{{::dialog.placeholder}}" ng-required="dialog.required">'," </md-input-container>"," </md-dialog-content>"," <md-dialog-actions>",' <md-button ng-if="dialog.$type === \'confirm\' || dialog.$type === \'prompt\'" ng-click="dialog.abort()" class="md-primary md-cancel-button">'," {{ dialog.cancel }}"," </md-button>",' <md-button ng-click="dialog.hide()" class="md-primary md-confirm-button" md-autofocus="dialog.$type===\'alert\'" ng-disabled="dialog.required && !dialog.result">'," {{ dialog.ok }}"," </md-button>"," </md-dialog-actions>","</md-dialog>"].join("").replace(/\s\s+/g,""),controller:n,controllerAs:"dialog",bindToController:!0}}function n(o,a){this.$onInit=function(){var n="prompt"==this.$type;n&&this.initialValue&&(this.result=this.initialValue),this.hide=function(){o.hide(!n||this.result)},this.abort=function(){o.cancel()},this.keypress=function(e){var t=n&&this.required&&!angular.isDefined(this.result);e.keyCode!==a.KEY_CODE.ENTER||t||o.hide(this.result)}}}function o(m,l,g,p,i,d,f,r,s,c,t,u,h){return{hasBackdrop:!0,isolateScope:!0,onCompiling:function(e){e.defaultTheme=t.defaultTheme(),function(t){var e;t.targetEvent&&t.targetEvent.target&&(e=angular.element(t.targetEvent.target));var n=e&&e.controller("mdTheme");if(t.hasTheme=!!n,!t.hasTheme)return;t.themeWatch=n.$shouldWatch;var o=t.theme||n.$mdTheme;o&&(t.scope.theme=o);var a=n.registerChanges(function(e){t.scope.theme=e,t.themeWatch||a()})}(e)},onShow:function(e,t,n,o){angular.element(d[0].body).addClass("md-dialog-is-showing");var a=t.find("md-dialog");if(a.hasClass("ng-cloak")){s.warn("$mdDialog: using `<md-dialog ng-cloak>` will affect the dialog opening animations.",t[0])}return function(e){e.origin=angular.extend({element:null,bounds:null,focus:angular.noop},e.origin||{}),e.parent=n(e.parent,r),e.closeTo=t(n(e.closeTo)),e.openFrom=t(n(e.openFrom)),e.targetEvent&&(e.origin=t(e.targetEvent.target,e.origin),e.originInteraction=h.getLastInteractionType());function t(e,t){var n=angular.element(e||{});if(n&&n.length){var o=angular.isFunction(n[0].getBoundin
|