Merge branch 'MDL-88009-501' of https://github.com/andrewnicols/moodle into MOODLE_501_STABLE
This commit is contained in:
+1
-1
@@ -5,6 +5,6 @@ define("theme_boost/footer-popover",["exports","./bootstrap/popover"],(function(
|
||||
* @module theme_boost/footer-popover
|
||||
* @copyright 2021 Bas Brands
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),Object.defineProperty(_exports,"Popover",{enumerable:!0,get:function(){return _popover.default}}),_exports.init=void 0,_popover=(obj=_popover)&&obj.__esModule?obj:{default:obj};const SELECTORS_FOOTERCONTAINER='[data-region="footer-container-popover"]',SELECTORS_FOOTERCONTENT='[data-region="footer-content-popover"]',SELECTORS_FOOTERBUTTON='[data-action="footer-popover"]',SELECTORS_FOOTERARROW='[data-region="footer-container-popover"] .popover-arrow';let footerIsShown=!1;_exports.init=()=>{const container=document.querySelector(SELECTORS_FOOTERCONTAINER),footerButton=document.querySelector(SELECTORS_FOOTERBUTTON),footerArrow=document.querySelector(SELECTORS_FOOTERARROW);new _popover.default(footerButton,{content:getFooterContent,container:container,html:!0,placement:"top",fallbackPlacements:["bottom"],customClass:"footer",trigger:"click",boundary:"viewport",modifiers:[{name:"preventOverflow",options:{boundariesElement:"viewport",padding:48}},{name:"arrow",options:{element:footerArrow}}]}),document.addEventListener("click",(e=>{footerIsShown&&!e.target.closest(SELECTORS_FOOTERCONTAINER)&&_popover.default.getInstance(footerButton).hide()}),!0),document.addEventListener("keydown",(e=>{footerIsShown&&"Escape"===e.key&&(_popover.default.getInstance(footerButton).hide(),footerButton.focus())})),document.addEventListener("focus",(e=>{footerIsShown&&!e.target.closest(SELECTORS_FOOTERCONTAINER)&&_popover.default.getInstance(footerButton).hide()}),!0),footerButton.addEventListener("show.bs.popover",(()=>{footerIsShown=!0})),footerButton.addEventListener("hide.bs.popover",(()=>{footerIsShown=!1}))};const getFooterContent=()=>document.querySelector(SELECTORS_FOOTERCONTENT).innerHTML}));
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),Object.defineProperty(_exports,"Popover",{enumerable:!0,get:function(){return _popover.default}}),_exports.init=void 0,_popover=(obj=_popover)&&obj.__esModule?obj:{default:obj};const SELECTORS_FOOTERCONTAINER='[data-region="footer-container-popover"]',SELECTORS_FOOTERCONTENT='[data-region="footer-content-popover"]',SELECTORS_FOOTERBUTTON='[data-action="footer-popover"]',SELECTORS_FOOTERARROW='[data-region="footer-container-popover"] .popover-arrow';let footerIsShown=!1;_exports.init=()=>{const container=document.querySelector(SELECTORS_FOOTERCONTAINER),footerButton=document.querySelector(SELECTORS_FOOTERBUTTON),footerArrow=document.querySelector(SELECTORS_FOOTERARROW);new _popover.default(footerButton,{content:getFooterContent,container:container,sanitize:!1,html:!0,placement:"top",fallbackPlacements:["bottom"],customClass:"footer",trigger:"click",boundary:"viewport",modifiers:[{name:"preventOverflow",options:{boundariesElement:"viewport",padding:48}},{name:"arrow",options:{element:footerArrow}}]}),document.addEventListener("click",(e=>{footerIsShown&&!e.target.closest(SELECTORS_FOOTERCONTAINER)&&_popover.default.getInstance(footerButton).hide()}),!0),document.addEventListener("keydown",(e=>{footerIsShown&&"Escape"===e.key&&(_popover.default.getInstance(footerButton).hide(),footerButton.focus())})),document.addEventListener("focus",(e=>{footerIsShown&&!e.target.closest(SELECTORS_FOOTERCONTAINER)&&_popover.default.getInstance(footerButton).hide()}),!0),footerButton.addEventListener("show.bs.popover",(()=>{footerIsShown=!0})),footerButton.addEventListener("hide.bs.popover",(()=>{footerIsShown=!1}))};const getFooterContent=()=>document.querySelector(SELECTORS_FOOTERCONTENT).innerHTML}));
|
||||
|
||||
//# sourceMappingURL=footer-popover.min.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"footer-popover.min.js","sources":["../src/footer-popover.js"],"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 * Shows the footer content in a popover.\n *\n * @module theme_boost/footer-popover\n * @copyright 2021 Bas Brands\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Popover from './bootstrap/popover';\n\nconst SELECTORS = {\n FOOTERCONTAINER: '[data-region=\"footer-container-popover\"]',\n FOOTERCONTENT: '[data-region=\"footer-content-popover\"]',\n FOOTERBUTTON: '[data-action=\"footer-popover\"]',\n FOOTERARROW: '[data-region=\"footer-container-popover\"] .popover-arrow',\n};\n\nlet footerIsShown = false;\n\nexport const init = () => {\n const container = document.querySelector(SELECTORS.FOOTERCONTAINER);\n const footerButton = document.querySelector(SELECTORS.FOOTERBUTTON);\n const footerArrow = document.querySelector(SELECTORS.FOOTERARROW);\n\n new Popover(footerButton, {\n content: getFooterContent,\n container: container,\n html: true,\n placement: 'top',\n fallbackPlacements: ['bottom'],\n customClass: 'footer',\n trigger: 'click',\n boundary: 'viewport',\n modifiers: [\n {\n name: 'preventOverflow',\n options: {\n boundariesElement: 'viewport',\n padding: 48,\n },\n },\n {\n name: 'arrow',\n options: {\n element: footerArrow,\n },\n },\n ]\n });\n\n document.addEventListener('click', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n Popover.getInstance(footerButton).hide();\n }\n },\n true);\n\n document.addEventListener('keydown', e => {\n if (footerIsShown && e.key === 'Escape') {\n Popover.getInstance(footerButton).hide();\n footerButton.focus();\n }\n });\n\n document.addEventListener('focus', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n Popover.getInstance(footerButton).hide();\n }\n },\n true);\n\n footerButton.addEventListener('show.bs.popover', () => {\n footerIsShown = true;\n });\n\n footerButton.addEventListener('hide.bs.popover', () => {\n footerIsShown = false;\n });\n};\n\n/**\n * Get the footer content for popover.\n *\n * @returns {String} HTML string\n * @private\n */\nconst getFooterContent = () => {\n return document.querySelector(SELECTORS.FOOTERCONTENT).innerHTML;\n};\n\nexport {\n Popover\n};\n"],"names":["SELECTORS","footerIsShown","container","document","querySelector","footerButton","footerArrow","Popover","content","getFooterContent","html","placement","fallbackPlacements","customClass","trigger","boundary","modifiers","name","options","boundariesElement","padding","element","addEventListener","e","target","closest","getInstance","hide","key","focus","innerHTML"],"mappings":";;;;;;;oPAyBMA,0BACe,2CADfA,wBAEa,yCAFbA,uBAGY,iCAHZA,sBAIW,8DAGbC,eAAgB,gBAEA,WACVC,UAAYC,SAASC,cAAcJ,2BACnCK,aAAeF,SAASC,cAAcJ,wBACtCM,YAAcH,SAASC,cAAcJ,2BAEvCO,iBAAQF,aAAc,CACtBG,QAASC,iBACTP,UAAWA,UACXQ,MAAM,EACNC,UAAW,MACXC,mBAAoB,CAAC,UACrBC,YAAa,SACbC,QAAS,QACTC,SAAU,WACVC,UAAW,CACP,CACIC,KAAM,kBACNC,QAAS,CACLC,kBAAmB,WACnBC,QAAS,KAGjB,CACIH,KAAM,QACNC,QAAS,CACLG,QAASf,iBAMzBH,SAASmB,iBAAiB,SAASC,IAC3BtB,gBAAkBsB,EAAEC,OAAOC,QAAQzB,6CAC3B0B,YAAYrB,cAAcsB,UAG1C,GAEAxB,SAASmB,iBAAiB,WAAWC,IAC7BtB,eAA2B,WAAVsB,EAAEK,uBACXF,YAAYrB,cAAcsB,OAClCtB,aAAawB,YAIrB1B,SAASmB,iBAAiB,SAASC,IAC3BtB,gBAAkBsB,EAAEC,OAAOC,QAAQzB,6CAC3B0B,YAAYrB,cAAcsB,UAG1C,GAEAtB,aAAaiB,iBAAiB,mBAAmB,KAC7CrB,eAAgB,KAGpBI,aAAaiB,iBAAiB,mBAAmB,KAC7CrB,eAAgB,YAUlBQ,iBAAmB,IACdN,SAASC,cAAcJ,yBAAyB8B"}
|
||||
{"version":3,"file":"footer-popover.min.js","sources":["../src/footer-popover.js"],"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 * Shows the footer content in a popover.\n *\n * @module theme_boost/footer-popover\n * @copyright 2021 Bas Brands\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Popover from './bootstrap/popover';\n\nconst SELECTORS = {\n FOOTERCONTAINER: '[data-region=\"footer-container-popover\"]',\n FOOTERCONTENT: '[data-region=\"footer-content-popover\"]',\n FOOTERBUTTON: '[data-action=\"footer-popover\"]',\n FOOTERARROW: '[data-region=\"footer-container-popover\"] .popover-arrow',\n};\n\nlet footerIsShown = false;\n\nexport const init = () => {\n const container = document.querySelector(SELECTORS.FOOTERCONTAINER);\n const footerButton = document.querySelector(SELECTORS.FOOTERBUTTON);\n const footerArrow = document.querySelector(SELECTORS.FOOTERARROW);\n\n new Popover(footerButton, {\n content: getFooterContent,\n container: container,\n sanitize: false,\n html: true,\n placement: 'top',\n fallbackPlacements: ['bottom'],\n customClass: 'footer',\n trigger: 'click',\n boundary: 'viewport',\n modifiers: [\n {\n name: 'preventOverflow',\n options: {\n boundariesElement: 'viewport',\n padding: 48,\n },\n },\n {\n name: 'arrow',\n options: {\n element: footerArrow,\n },\n },\n ]\n });\n\n document.addEventListener('click', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n Popover.getInstance(footerButton).hide();\n }\n },\n true);\n\n document.addEventListener('keydown', e => {\n if (footerIsShown && e.key === 'Escape') {\n Popover.getInstance(footerButton).hide();\n footerButton.focus();\n }\n });\n\n document.addEventListener('focus', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n Popover.getInstance(footerButton).hide();\n }\n },\n true);\n\n footerButton.addEventListener('show.bs.popover', () => {\n footerIsShown = true;\n });\n\n footerButton.addEventListener('hide.bs.popover', () => {\n footerIsShown = false;\n });\n};\n\n/**\n * Get the footer content for popover.\n *\n * @returns {String} HTML string\n * @private\n */\nconst getFooterContent = () => {\n return document.querySelector(SELECTORS.FOOTERCONTENT).innerHTML;\n};\n\nexport {\n Popover\n};\n"],"names":["SELECTORS","footerIsShown","container","document","querySelector","footerButton","footerArrow","Popover","content","getFooterContent","sanitize","html","placement","fallbackPlacements","customClass","trigger","boundary","modifiers","name","options","boundariesElement","padding","element","addEventListener","e","target","closest","getInstance","hide","key","focus","innerHTML"],"mappings":";;;;;;;oPAyBMA,0BACe,2CADfA,wBAEa,yCAFbA,uBAGY,iCAHZA,sBAIW,8DAGbC,eAAgB,gBAEA,WACVC,UAAYC,SAASC,cAAcJ,2BACnCK,aAAeF,SAASC,cAAcJ,wBACtCM,YAAcH,SAASC,cAAcJ,2BAEvCO,iBAAQF,aAAc,CACtBG,QAASC,iBACTP,UAAWA,UACXQ,UAAU,EACVC,MAAM,EACNC,UAAW,MACXC,mBAAoB,CAAC,UACrBC,YAAa,SACbC,QAAS,QACTC,SAAU,WACVC,UAAW,CACP,CACIC,KAAM,kBACNC,QAAS,CACLC,kBAAmB,WACnBC,QAAS,KAGjB,CACIH,KAAM,QACNC,QAAS,CACLG,QAAShB,iBAMzBH,SAASoB,iBAAiB,SAASC,IAC3BvB,gBAAkBuB,EAAEC,OAAOC,QAAQ1B,6CAC3B2B,YAAYtB,cAAcuB,UAG1C,GAEAzB,SAASoB,iBAAiB,WAAWC,IAC7BvB,eAA2B,WAAVuB,EAAEK,uBACXF,YAAYtB,cAAcuB,OAClCvB,aAAayB,YAIrB3B,SAASoB,iBAAiB,SAASC,IAC3BvB,gBAAkBuB,EAAEC,OAAOC,QAAQ1B,6CAC3B2B,YAAYtB,cAAcuB,UAG1C,GAEAvB,aAAakB,iBAAiB,mBAAmB,KAC7CtB,eAAgB,KAGpBI,aAAakB,iBAAiB,mBAAmB,KAC7CtB,eAAgB,YAUlBQ,iBAAmB,IACdN,SAASC,cAAcJ,yBAAyB+B"}
|
||||
@@ -40,6 +40,7 @@ export const init = () => {
|
||||
new Popover(footerButton, {
|
||||
content: getFooterContent,
|
||||
container: container,
|
||||
sanitize: false,
|
||||
html: true,
|
||||
placement: 'top',
|
||||
fallbackPlacements: ['bottom'],
|
||||
|
||||
Reference in New Issue
Block a user