MDL-68833 theme_boost: Add ./pending event checks back
[moodle.git] / theme / boost / amd / build / loader.min.js.map
CommitLineData
721c29ff 1{"version":3,"sources":["../src/loader.js"],"names":["rememberTabs","on","e","hash","target","attr","history","replaceState","location","window","tab","enablePopovers","popover","selector","trigger","placement","CustomEvents","define","events","escape","enableTooltips","tooltip","container","init","pendingPromise","Pending","Scroll","$","fn","dropdown","Constructor","Default","flip","Aria","resolve"],"mappings":"sVA0BA,OACA,OACA,OACA,OACA,OACA,OACA,O,sDAKMA,CAAAA,CAAY,CAAG,UAAM,CACvB,cAAE,wBAAF,EAA0BC,EAA1B,CAA6B,cAA7B,CAA6C,SAASC,CAAT,CAAY,CACrD,GAAIC,CAAAA,CAAI,CAAG,cAAED,CAAC,CAACE,MAAJ,EAAYC,IAAZ,CAAiB,MAAjB,CAAX,CACA,GAAIC,OAAO,CAACC,YAAZ,CAA0B,CACtBD,OAAO,CAACC,YAAR,CAAqB,IAArB,CAA2B,IAA3B,CAAiCJ,CAAjC,CACH,CAFD,IAEO,CACHK,QAAQ,CAACL,IAAT,CAAgBA,CACnB,CACJ,CAPD,EAQA,GAAIA,CAAAA,CAAI,CAAGM,MAAM,CAACD,QAAP,CAAgBL,IAA3B,CACA,GAAIA,CAAJ,CAAU,CACP,cAAE,oBAAqBA,CAArB,CAA4B,KAA9B,EAAoCO,GAApC,CAAwC,MAAxC,CACF,CACJ,C,CAMKC,CAAc,CAAG,UAAM,CACzB,cAAE,MAAF,EAAUC,OAAV,CAAkB,CACdC,QAAQ,CAAE,2BADI,CAEdC,OAAO,CAAE,aAFK,CAGdC,SAAS,CAAE,MAHG,CAAlB,EAMAC,UAAaC,MAAb,CAAoB,cAAE,MAAF,CAApB,CAA+B,CAC3BD,UAAaE,MAAb,CAAoBC,MADO,CAA/B,EAGA,cAAE,MAAF,EAAUlB,EAAV,CAAae,UAAaE,MAAb,CAAoBC,MAAjC,CAAyC,uBAAzC,CAAkE,UAAW,CACzE,cAAE,IAAF,EAAQL,OAAR,CAAgB,MAAhB,CACH,CAFD,CAGH,C,CAMKM,CAAc,CAAG,UAAM,CACzB,cAAE,MAAF,EAAUC,OAAV,CAAkB,CACdC,SAAS,CAAE,MADG,CAEdT,QAAQ,CAAE,2BAFI,CAAlB,CAIH,C,CAKKU,CAAI,CAAG,UAAM,CACf,GAAMC,CAAAA,CAAc,CAAG,GAAIC,UAAJ,CAAY,yBAAZ,CAAvB,CAEA,gBAGAzB,CAAY,GAGZW,CAAc,GAGdS,CAAc,GAGb,GAAIM,UAAJ,EAAD,CAAeH,IAAf,GAGAI,UAAEC,EAAF,CAAKC,QAAL,CAAcC,WAAd,CAA0BC,OAA1B,CAAkCC,IAAlC,IAGAC,UAAKV,IAAL,GAEAC,CAAc,CAACU,OAAf,EACH,C","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 * Template renderer for Moodle. Load and render Moodle templates with Mustache.\n *\n * @module core/templates\n * @package core\n * @class templates\n * @copyright 2015 Damyon Wiese <damyon@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\n\nimport $ from 'jquery';\nimport Aria from './aria';\nimport Bootstrap from './bootstrap/index';\nimport CustomEvents from 'core/custom_interaction_events';\nimport Pending from 'core/pending';\nimport Scroll from './scroll';\nimport setupBootstrapPendingChecks from './pending';\n\n/**\n * Rember the last visited tabs.\n */\nconst rememberTabs = () => {\n $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function(e) {\n var hash = $(e.target).attr('href');\n if (history.replaceState) {\n history.replaceState(null, null, hash);\n } else {\n location.hash = hash;\n }\n });\n var hash = window.location.hash;\n if (hash) {\n $('.nav-link[href=\"' + hash + '\"]').tab('show');\n }\n};\n\n/**\n * Enable all popovers\n *\n */\nconst enablePopovers = () => {\n $('body').popover({\n selector: '[data-toggle=\"popover\"]',\n trigger: 'focus hover',\n placement: 'auto'\n });\n\n CustomEvents.define($('body'), [\n CustomEvents.events.escape,\n ]);\n $('body').on(CustomEvents.events.escape, '[data-toggle=popover]', function() {\n $(this).trigger('blur');\n });\n};\n\n/**\n * Enable tooltips\n *\n */\nconst enableTooltips = () => {\n $('body').tooltip({\n container: 'body',\n selector: '[data-toggle=\"tooltip\"]'\n });\n};\n\n/**\n * Bootstrap init function\n */\nconst init = () => {\n const pendingPromise = new Pending('theme_boost/loader:init');\n\n setupBootstrapPendingChecks();\n\n // Remember the last visited tabs.\n rememberTabs();\n\n // Enable all popovers.\n enablePopovers();\n\n // Enable all tooltips.\n enableTooltips();\n\n // Add scroll handling.\n (new Scroll()).init();\n\n // Disables flipping the dropdowns up and getting hidden behind the navbar.\n $.fn.dropdown.Constructor.Default.flip = false;\n\n // Setup Aria helpers for Bootstrap features.\n Aria.init();\n\n pendingPromise.resolve();\n};\n\n/**\n * Set up the search.\n *\n * @method init\n */\nexport {\n init,\n Bootstrap\n};\n"],"file":"loader.min.js"}