Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/modal_backdrop.min.js.map |
{"version":3,"sources":["../src/modal_backdrop.js"],"names":["define","$","Templates","Notification","SELECTORS","ROOT","ModalBackdrop","root","isAttached","is","exception","message","prototype","getRoot","attachToDOM","append","setZIndex","value","css","isVisible","hasClass","hasTransitions","show","removeClass","addClass","hide","one","bind","destroy","remove"],"mappings":"AAwBAA,OAAM,uBAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAD,CACD,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CAAvB,CAAqC,IAElCC,CAAAA,CAAS,CAAG,CACZC,IAAI,CAAE,kCADM,CAFsB,CAWlCC,CAAa,CAAG,SAASC,CAAT,CAAe,CAC/B,KAAKA,IAAL,CAAYN,CAAC,CAACM,CAAD,CAAb,CACA,KAAKC,UAAL,IAEA,GAAI,CAAC,KAAKD,IAAL,CAAUE,EAAV,CAAaL,CAAS,CAACC,IAAvB,CAAL,CAAmC,CAC/BF,CAAY,CAACO,SAAb,CAAuB,CAACC,OAAO,CAAE,iCAAV,CAAvB,CACH,CACJ,CAlBqC,CA0BtCL,CAAa,CAACM,SAAd,CAAwBC,OAAxB,CAAkC,UAAW,CACzC,MAAO,MAAKN,IACf,CAFD,CASAD,CAAa,CAACM,SAAd,CAAwBE,WAAxB,CAAsC,UAAW,CAC7C,GAAI,KAAKN,UAAT,CAAqB,CACjB,MACH,CAEDP,CAAC,CAAC,MAAD,CAAD,CAAUc,MAAV,CAAiB,KAAKR,IAAtB,EACA,KAAKC,UAAL,GACH,CAPD,CAeAF,CAAa,CAACM,SAAd,CAAwBI,SAAxB,CAAoC,SAASC,CAAT,CAAgB,CAChD,KAAKV,IAAL,CAAUW,GAAV,CAAc,SAAd,CAAyBD,CAAzB,CACH,CAFD,CAUAX,CAAa,CAACM,SAAd,CAAwBO,SAAxB,CAAoC,UAAW,CAC3C,MAAO,MAAKZ,IAAL,CAAUa,QAAV,CAAmB,MAAnB,CACV,CAFD,CAUAd,CAAa,CAACM,SAAd,CAAwBS,cAAxB,CAAyC,UAAW,CAChD,MAAO,MAAKR,OAAL,GAAeO,QAAf,CAAwB,MAAxB,CACV,CAFD,CAUAd,CAAa,CAACM,SAAd,CAAwBU,IAAxB,CAA+B,UAAW,CACtC,GAAI,KAAKH,SAAL,EAAJ,CAAsB,CAClB,MACH,CAED,GAAI,CAAC,KAAKX,UAAV,CAAsB,CAClB,KAAKM,WAAL,EACH,CAED,KAAKP,IAAL,CAAUgB,WAAV,CAAsB,MAAtB,EAA8BC,QAA9B,CAAuC,MAAvC,CACH,CAVD,CAiBAlB,CAAa,CAACM,SAAd,CAAwBa,IAAxB,CAA+B,UAAW,CACtC,GAAI,CAAC,KAAKN,SAAL,EAAL,CAAuB,CACnB,MACH,CAED,GAAI,KAAKE,cAAL,EAAJ,CAA2B,CAEvB,KAAKR,OAAL,GAAea,GAAf,CAAmB,kDAAnB,CAAuE,UAAW,CAC9E,KAAKb,OAAL,GAAeU,WAAf,CAA2B,MAA3B,EAAmCC,QAAnC,CAA4C,MAA5C,CACH,CAFsE,CAErEG,IAFqE,CAEhE,IAFgE,CAAvE,CAGH,CALD,IAKO,CACH,KAAKd,OAAL,GAAeU,WAAf,CAA2B,MAA3B,EAAmCC,QAAnC,CAA4C,MAA5C,CACH,CACJ,CAbD,CAoBAlB,CAAa,CAACM,SAAd,CAAwBgB,OAAxB,CAAkC,UAAW,CACzC,KAAKrB,IAAL,CAAUsB,MAAV,EACH,CAFD,CAIA,MAAOvB,CAAAA,CACV,CA3HK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the logic for modal backdrops.\n *\n * @module core/modal_backdrop\n * @class modal_backdrop\n * @package core\n * @copyright 2016 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification'],\n function($, Templates, Notification) {\n\n var SELECTORS = {\n ROOT: '[data-region=\"modal-backdrop\"]',\n };\n\n /**\n * Constructor for ModalBackdrop.\n *\n * @param {object} root The root element for the modal backdrop\n */\n var ModalBackdrop = function(root) {\n this.root = $(root);\n this.isAttached = false;\n\n if (!this.root.is(SELECTORS.ROOT)) {\n Notification.exception({message: 'Element is not a modal backdrop'});\n }\n };\n\n /**\n * Get the root element of this modal backdrop.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n ModalBackdrop.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Add the modal backdrop to the page, if it hasn't already been added.\n *\n * @method attachToDOM\n */\n ModalBackdrop.prototype.attachToDOM = function() {\n if (this.isAttached) {\n return;\n }\n\n $('body').append(this.root);\n this.isAttached = true;\n };\n\n /**\n * Set the z-index value for this backdrop.\n *\n * @method setZIndex\n * @param {int} value The z-index value\n */\n ModalBackdrop.prototype.setZIndex = function(value) {\n this.root.css('z-index', value);\n };\n\n /**\n * Check if this backdrop is visible.\n *\n * @method isVisible\n * @return {bool}\n */\n ModalBackdrop.prototype.isVisible = function() {\n return this.root.hasClass('show');\n };\n\n /**\n * Check if this backdrop has CSS transitions applied.\n *\n * @method hasTransitions\n * @return {bool}\n */\n ModalBackdrop.prototype.hasTransitions = function() {\n return this.getRoot().hasClass('fade');\n };\n\n /**\n * Display this backdrop. The backdrop will be attached to the DOM if it hasn't\n * already been.\n *\n * @method show\n */\n ModalBackdrop.prototype.show = function() {\n if (this.isVisible()) {\n return;\n }\n\n if (!this.isAttached) {\n this.attachToDOM();\n }\n\n this.root.removeClass('hide').addClass('show');\n };\n\n /**\n * Hide this backdrop.\n *\n * @method hide\n */\n ModalBackdrop.prototype.hide = function() {\n if (!this.isVisible()) {\n return;\n }\n\n if (this.hasTransitions()) {\n // Wait for CSS transitions to complete before hiding the element.\n this.getRoot().one('transitionend webkitTransitionEnd oTransitionEnd', function() {\n this.getRoot().removeClass('show').addClass('hide');\n }.bind(this));\n } else {\n this.getRoot().removeClass('show').addClass('hide');\n }\n };\n\n /**\n * Remove this backdrop from the DOM.\n *\n * @method destroy\n */\n ModalBackdrop.prototype.destroy = function() {\n this.root.remove();\n };\n\n return ModalBackdrop;\n});\n"],"file":"modal_backdrop.min.js"}