7 lines
4.2 KiB
JavaScript
Raw Normal View History

2020-05-19 11:43:42 +03:00
/*!
* AngularJS Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.18-master-97a1616
*/
!function(e,E,F){"use strict";function n(o,r,i,s){var d="SideNav '{0}' is not available! Did you use md-component-id='{0}'?",l={find:function(e,n){var t=o.get(e);return t||n?t:(s.error(r.supplant(d,[e||""])),F)},waitFor:c};return function(e,n){if(E.isUndefined(e))return l;var t=!0===n,o=l.find(e,t);return!o&&t?l.waitFor(e):!o&&E.isUndefined(n)?function(e,n){function t(){return!1}function o(){return i.when(r.supplant(d,[n||""]))}return E.extend({isLockedOpen:t,isOpen:t,toggle:o,open:o,close:o,onClose:E.noop,then:function(e){return c(n).then(e||E.noop)}},e)}(l,e):o};function c(e){return o.when(e).catch(s.error)}}function t(o,v,h,y,C,O,e,w,b,k,S,D,T){return{restrict:"E",scope:{isOpen:"=?mdIsOpen"},controller:"$mdSidenavController",compile:function(e){return e.addClass("md-closed").attr("tabIndex","-1"),n}};function n(r,i,e,n){var s,d,l,c,a,u=null,p=null,m=k.when(!0),t=w(e.mdIsLockedOpen),f=E.element(D);function $(e){return e.keyCode===h.KEY_CODE.ESCAPE?g(e):k.when(!0)}function g(e){return e.preventDefault(),n.close()}e.mdDisableScrollTarget&&((u=S[0].querySelector(e.mdDisableScrollTarget))?u=E.element(u):b.warn(v.supplant('mdSidenav: couldn\'t find element matching selector "{selector}". Falling back to parent.',{selector:e.mdDisableScrollTarget}))),u=u||i.parent(),e.hasOwnProperty("mdDisableBackdrop")||(d=v.createBackdrop(r,"md-sidenav-backdrop md-opaque ng-enter")),e.hasOwnProperty("mdDisableCloseEvents")&&(l=!0),i.addClass("_md"),y(i),d&&y.inherit(d,i),i.on("$destroy",function(){d&&d.remove(),n.destroy()}),r.$on("$destroy",function(){d&&d.remove()}),r.$watch(function(){return t(r.$parent,{$media:function(e){return b.warn("$media is deprecated for is-locked-open. Use $mdMedia instead."),o(e)},$mdMedia:o})},function(e,n){(r.isLockedOpen=e)===n?i.toggleClass("md-locked-open",!!e):O[e?"addClass":"removeClass"](i,"md-locked-open");d&&d.toggleClass("md-locked-open",!!e)}),r.$watch("isOpen",function(e){var n,t=v.findFocusTarget(i)||v.findFocusTarget(i,"[md-sidenav-focus]")||i,o=i.parent();l||(o[e?"on":"off"]("keydown",$),d&&d[e?"on":"off"]("click",g));n=function(e,n){var t=i[0],o=e[0].scrollTop;if(n&&o){a={top:t.style.top,bottom:t.style.bottom,height:t.style.height};var r={top:o+"px",bottom:"auto",height:e[0].clientHeight+"px"};i.css(r),d.css(r)}if(!n&&a)return function(){t.style.top=a.top,t.style.bottom=a.bottom,t.style.height=a.height,d[0].style.top=null,d[0].style.bottom=null,d[0].style.height=null,a=null}}(o,e),e&&(p=S[0].activeElement,c=C.getLastInteractionType());return function(e){e&&!s?(s=u.css("overflow"),u.css("overflow","hidden")):E.isDefined(s)&&(u.css("overflow",s),s=F)}(e),m=k.all([e&&d?O.enter(d,o):d?O.leave(d):k.when(!0),O[e?"removeClass":"addClass"](i,"md-closed")]).then(function(){r.isOpen&&(T(function(){f.triggerHandler("resize")}),t&&t.focus()),n&&n()})}),n.$toggleOpen=function(e){return r.isOpen===e?k.when(!0):(r.isOpen&&n.onCloseCb&&n.onCloseCb(),k(function(n){r.isOpen=e,v.nextTick(function(){m.then(function(e){!r.isOpen&&p&&"keyboard"===c&&(p.focus(),p=null),n(e)})})}))}}}function o(n,e,t,o,r){var i=this;i.isOpen=function(){return!!n.isOpen},i.isLockedOpen=function(){return!!n.isLockedOpen},i.onClose=function(e){return i.onCloseCb=e,i},i.open=function(){return i.$toggleOpen(!0)},i.close=function(){return i.$toggleOpen(!1)},i.toggle=function(){return i.$toggleOpen(!n.isOpen)},i.$toggleOpen=function(e){return o.when(n.isOpen=e)};var s=e.mdComponentId,d=s&&-1<s.indexOf(r.startSymbol()),l=d?r(s)(n.$parent):s;i.destroy=t.register(i,l),d&&e.$observe("mdComponentId",function(e){e&&e!==i.$$mdHandle&&(i.destroy(),i.destroy=t.register(i,e))})}n.$inject=["$mdComponentRegistry","$mdUtil","$q","$log"],t.$inject=["$mdMedia","$mdUtil","$mdConstant","$mdTheming","$mdInteraction","$animate","$compile","$parse","$log","$q","$document","$window","$$rAF"],o.$inject=["$scope","$attrs","$mdComponentRegistry","$q","$interpolate"],E.module("material.components.sidenav",["material.core","material.components.backdrop"]).factory("$mdSidenav",n).directive("mdSidenav",t).directive("mdSidenavFocus",function(){return{restrict:"A",requ