Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

define("core/modal_backdrop",["exports","jquery","./notification","./fullscreen"],(function(_exports,_jquery,Notification,Fullscreen){var obj;function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_jquery=(obj=_jquery)&&obj.__esModule?obj:{default:obj},Notification=_interopRequireWildcard(Notification),Fullscreen=_interopRequireWildcard(Fullscreen);const SELECTORS_ROOT='[data-region="modal-backdrop"]';return _exports.default=class{constructor(root){_defineProperty(this,"root",null),_defineProperty(this,"isAttached",!1),_defineProperty(this,"attachmentPoint",null),this.root=(0,_jquery.default)(root),this.isAttached=!1,this.attachmentPoint=document.createElement("div"),document.body.append(this.attachmentPoint),this.root.is(SELECTORS_ROOT)||Notification.exception({message:"Element is not a modal backdrop"})}getRoot(){return this.root}getAttachmentPoint(){return(0,_jquery.default)(Fullscreen.getElement()||this.attachmentPoint)}attachToDOM(){this.getAttachmentPoint().append(this.root),this.isAttached||(this.isAttached=!0)}setZIndex(value){this.root.css("z-index",value)}isVisible(){return this.root.hasClass("show")}hasTransitions(){return this.getRoot().hasClass("fade")}show(){this.isVisible()||(this.attachToDOM(),this.root.removeClass("hide").addClass("show"))}hide(){this.isVisible()&&(this.hasTransitions()?this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",(()=>{this.getRoot().removeClass("show").addClass("hide")})):this.getRoot().removeClass("show").addClass("hide"),(0,_jquery.default)(document.body).find(this.getRoot()).length&&(0,_jquery.default)(document.body).append(this.getRoot()))}destroy(){this.root.remove(),this.attachmentPoint.remove()}},_exports.default}));

//# sourceMappingURL=modal_backdrop.min.js.map