Proyectos de Subversion Moodle

Rev

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

define("theme_boost/sticky-footer",["exports","core/pending","core/sticky-footer"],(function(_exports,_pending,_stickyFooter){var obj;
/**
   * Sticky footer module.
   *
   * @module     theme_boost/sticky-footer
   * @copyright  2022 Ferran Recio <ferran@moodle.com>
   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
   */Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=_exports.enableStickyFooter=_exports.disableStickyFooter=void 0,_pending=(obj=_pending)&&obj.__esModule?obj:{default:obj};const SELECTORS_STICKYFOOTER=".stickyfooter",SELECTORS_PAGE="#page",CLASSES_HASSTICKYFOOTER="hasstickyfooter";let initialized=!1,previousScrollPosition=0,enabled=!1;const scrollSpy=()=>{if(!enabled)return;if(document.body.clientWidth>=768)return;let scrollPosition=window.scrollY;scrollPosition>previousScrollPosition?hideStickyFooter():showStickyFooter(),previousScrollPosition=scrollPosition},showStickyFooter=()=>{const pendingPromise=new _pending.default("theme_boost/sticky-footer:enabling"),footer=document.querySelector(SELECTORS_STICKYFOOTER),page=document.querySelector(SELECTORS_PAGE);footer&&page&&(document.body.classList.add(CLASSES_HASSTICKYFOOTER),page.classList.add(CLASSES_HASSTICKYFOOTER)),setTimeout((()=>pendingPromise.resolve()),1e3)},hideStickyFooter=()=>{document.body.classList.remove(CLASSES_HASSTICKYFOOTER);const page=document.querySelector(SELECTORS_PAGE);null==page||page.classList.remove(CLASSES_HASSTICKYFOOTER)},enableStickyFooter=()=>{enabled=!0,showStickyFooter()};_exports.enableStickyFooter=enableStickyFooter;const disableStickyFooter=()=>{enabled=!1,hideStickyFooter()};_exports.disableStickyFooter=disableStickyFooter;_exports.init=()=>{initialized||document.body.classList.contains("behat-site")?(0,_stickyFooter.init)():(initialized=!0,(()=>{const footer=document.querySelector(SELECTORS_STICKYFOOTER);return!!footer&&!!footer.dataset.disable})()||enableStickyFooter(),document.addEventListener("scroll",scrollSpy),(0,_stickyFooter.registerManager)({enableStickyFooter:enableStickyFooter,disableStickyFooter:disableStickyFooter}))}}));

//# sourceMappingURL=sticky-footer.min.js.map