mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-75625-master' of https://github.com/ferranrecio/moodle
This commit is contained in:
commit
63f31ccc7b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -35,7 +35,7 @@ import {getList} from 'core/normalise';
|
||||
import * as CourseEvents from 'core_course/events';
|
||||
import Pending from 'core/pending';
|
||||
import ContentTree from 'core_courseformat/local/courseeditor/contenttree';
|
||||
// The jQuery module is only used for interacting with Boostrap 4. It can we removed when MDL-79179 is integrated.
|
||||
// The jQuery module is only used for interacting with Boostrap 4. It can we removed when MDL-71979 is integrated.
|
||||
import jQuery from 'jquery';
|
||||
|
||||
// Load global strings.
|
||||
@ -261,7 +261,7 @@ export default class extends BaseComponent {
|
||||
);
|
||||
|
||||
// Open the cm section node if possible (Bootstrap 4 uses jQuery to interact with collapsibles).
|
||||
// All jQuery int this code can be replaced when MDL-79179 is integrated.
|
||||
// All jQuery int this code can be replaced when MDL-71979 is integrated.
|
||||
const sectionnode = currentElement.closest(this.selectors.SECTIONNODE);
|
||||
const toggler = jQuery(sectionnode).find(this.selectors.MODALTOGGLER);
|
||||
let collapsibleId = toggler.data('target') ?? toggler.attr('href');
|
||||
|
@ -61,7 +61,7 @@ export default class extends Tree {
|
||||
return this._getVisibleItems();
|
||||
};
|
||||
}
|
||||
// All jQuery events can be replaced when MDL-79179 is integrated.
|
||||
// All jQuery events can be replaced when MDL-71979 is integrated.
|
||||
this.treeRoot.on('hidden.bs.collapse shown.bs.collapse', () => {
|
||||
this.refreshVisibleItemsCache();
|
||||
});
|
||||
@ -146,7 +146,7 @@ export default class extends Tree {
|
||||
* @param {JQuery} item the jQuery object
|
||||
*/
|
||||
toggleGroup(item) {
|
||||
// All jQuery in this segment of code can be replaced when MDL-79179 is integrated.
|
||||
// All jQuery in this segment of code can be replaced when MDL-71979 is integrated.
|
||||
const toggler = item.find(this.selectors.COLLAPSE);
|
||||
let collapsibleId = toggler.data('target') ?? toggler.attr('href');
|
||||
if (!collapsibleId) {
|
||||
|
@ -192,7 +192,7 @@ export default class Component extends BaseComponent {
|
||||
|
||||
// Course index is based on Bootstrap 4 collapsibles. To collapse them we need jQuery to
|
||||
// interact with collapsibles methods. Hopefully, this will change in Bootstrap 5 because
|
||||
// it does not require jQuery anymore (when MDL-79179 is integrated).
|
||||
// it does not require jQuery anymore (when MDL-71979 is integrated).
|
||||
const togglerValue = (forceValue) ? 'show' : 'hide';
|
||||
jQuery(collapsible).collapse(togglerValue);
|
||||
}
|
||||
|
@ -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 $ from 'jquery';\nimport Popover from './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};\n\nlet footerIsShown = false;\n\nexport const init = () => {\n const container = document.querySelector(SELECTORS.FOOTERCONTAINER);\n const footerButton = document.querySelector(SELECTORS.FOOTERBUTTON);\n\n // All jQuery in this code can be replaced when MDL-79179 is integrated.\n $(footerButton).popover({\n content: getFooterContent,\n container: container,\n html: true,\n placement: 'top',\n customClass: 'footer',\n trigger: 'click'\n });\n\n document.addEventListener('click', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n $(footerButton).popover('hide');\n }\n },\n true);\n\n document.addEventListener('keydown', e => {\n if (footerIsShown && e.key === 'Escape') {\n $(footerButton).popover('hide');\n footerButton.focus();\n }\n });\n\n document.addEventListener('focus', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n $(footerButton).popover('hide');\n }\n },\n true);\n\n $(footerButton).on('show.bs.popover', () => {\n footerIsShown = true;\n });\n\n $(footerButton).on('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","popover","content","getFooterContent","html","placement","customClass","trigger","addEventListener","e","target","closest","key","focus","on","innerHTML"],"mappings":";;;;;;;4QA0BMA,0BACe,2CADfA,wBAEa,yCAFbA,uBAGY,qCAGdC,eAAgB,gBAEA,WACVC,UAAYC,SAASC,cAAcJ,2BACnCK,aAAeF,SAASC,cAAcJ,4CAG1CK,cAAcC,QAAQ,CACpBC,QAASC,iBACTN,UAAWA,UACXO,MAAM,EACNC,UAAW,MACXC,YAAa,SACbC,QAAS,UAGbT,SAASU,iBAAiB,SAASC,IAC3Bb,gBAAkBa,EAAEC,OAAOC,QAAQhB,gDACjCK,cAAcC,QAAQ,WAGhC,GAEAH,SAASU,iBAAiB,WAAWC,IAC7Bb,eAA2B,WAAVa,EAAEG,0BACjBZ,cAAcC,QAAQ,QACxBD,aAAaa,YAIrBf,SAASU,iBAAiB,SAASC,IAC3Bb,gBAAkBa,EAAEC,OAAOC,QAAQhB,gDACjCK,cAAcC,QAAQ,WAGhC,uBAEED,cAAcc,GAAG,mBAAmB,KAClClB,eAAgB,yBAGlBI,cAAcc,GAAG,mBAAmB,KAClClB,eAAgB,YAUlBO,iBAAmB,IACdL,SAASC,cAAcJ,yBAAyBoB"}
|
||||
{"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 $ from 'jquery';\nimport Popover from './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};\n\nlet footerIsShown = false;\n\nexport const init = () => {\n const container = document.querySelector(SELECTORS.FOOTERCONTAINER);\n const footerButton = document.querySelector(SELECTORS.FOOTERBUTTON);\n\n // All jQuery in this code can be replaced when MDL-71979 is integrated.\n $(footerButton).popover({\n content: getFooterContent,\n container: container,\n html: true,\n placement: 'top',\n customClass: 'footer',\n trigger: 'click'\n });\n\n document.addEventListener('click', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n $(footerButton).popover('hide');\n }\n },\n true);\n\n document.addEventListener('keydown', e => {\n if (footerIsShown && e.key === 'Escape') {\n $(footerButton).popover('hide');\n footerButton.focus();\n }\n });\n\n document.addEventListener('focus', e => {\n if (footerIsShown && !e.target.closest(SELECTORS.FOOTERCONTAINER)) {\n $(footerButton).popover('hide');\n }\n },\n true);\n\n $(footerButton).on('show.bs.popover', () => {\n footerIsShown = true;\n });\n\n $(footerButton).on('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","popover","content","getFooterContent","html","placement","customClass","trigger","addEventListener","e","target","closest","key","focus","on","innerHTML"],"mappings":";;;;;;;4QA0BMA,0BACe,2CADfA,wBAEa,yCAFbA,uBAGY,qCAGdC,eAAgB,gBAEA,WACVC,UAAYC,SAASC,cAAcJ,2BACnCK,aAAeF,SAASC,cAAcJ,4CAG1CK,cAAcC,QAAQ,CACpBC,QAASC,iBACTN,UAAWA,UACXO,MAAM,EACNC,UAAW,MACXC,YAAa,SACbC,QAAS,UAGbT,SAASU,iBAAiB,SAASC,IAC3Bb,gBAAkBa,EAAEC,OAAOC,QAAQhB,gDACjCK,cAAcC,QAAQ,WAGhC,GAEAH,SAASU,iBAAiB,WAAWC,IAC7Bb,eAA2B,WAAVa,EAAEG,0BACjBZ,cAAcC,QAAQ,QACxBD,aAAaa,YAIrBf,SAASU,iBAAiB,SAASC,IAC3Bb,gBAAkBa,EAAEC,OAAOC,QAAQhB,gDACjCK,cAAcC,QAAQ,WAGhC,uBAEED,cAAcc,GAAG,mBAAmB,KAClClB,eAAgB,yBAGlBI,cAAcc,GAAG,mBAAmB,KAClClB,eAAgB,YAUlBO,iBAAmB,IACdL,SAASC,cAAcJ,yBAAyBoB"}
|
@ -36,7 +36,7 @@ export const init = () => {
|
||||
const container = document.querySelector(SELECTORS.FOOTERCONTAINER);
|
||||
const footerButton = document.querySelector(SELECTORS.FOOTERBUTTON);
|
||||
|
||||
// All jQuery in this code can be replaced when MDL-79179 is integrated.
|
||||
// All jQuery in this code can be replaced when MDL-71979 is integrated.
|
||||
$(footerButton).popover({
|
||||
content: getFooterContent,
|
||||
container: container,
|
||||
|
Loading…
x
Reference in New Issue
Block a user