diff --git a/build/build-modules-js/build-bootstrap-js.es6.js b/build/build-modules-js/build-bootstrap-js.es6.js index 4d074f80a79cf..25b316747eaab 100644 --- a/build/build-modules-js/build-bootstrap-js.es6.js +++ b/build/build-modules-js/build-bootstrap-js.es6.js @@ -59,6 +59,7 @@ const build = async () => { 'node_modules/bootstrap/js/src/dom/manipulator.js', 'node_modules/bootstrap/js/src/dom/selector-engine.js', 'node_modules/bootstrap/js/src/util/index.js', + 'build/media_source/vendor/bootstrap/js/nojquerymode.es6.js', ], }, }); diff --git a/build/media_source/vendor/bootstrap/js/alert.es6.js b/build/media_source/vendor/bootstrap/js/alert.es6.js index 00e9e22677fa6..b7ef49fd1f241 100644 --- a/build/media_source/vendor/bootstrap/js/alert.es6.js +++ b/build/media_source/vendor/bootstrap/js/alert.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Alert from '../../../../../node_modules/bootstrap/js/src/alert'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Alert = Alert; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const alerts = Joomla.getOptions('bootstrap.alert'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/button.es6.js b/build/media_source/vendor/bootstrap/js/button.es6.js index 53fc1992df841..1198ae48a5444 100644 --- a/build/media_source/vendor/bootstrap/js/button.es6.js +++ b/build/media_source/vendor/bootstrap/js/button.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Button from '../../../../../node_modules/bootstrap/js/src/button'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Button = Button; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const buttons = Joomla.getOptions('bootstrap.button'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/carousel.es6.js b/build/media_source/vendor/bootstrap/js/carousel.es6.js index c530b9906e152..79727bccc7a5d 100644 --- a/build/media_source/vendor/bootstrap/js/carousel.es6.js +++ b/build/media_source/vendor/bootstrap/js/carousel.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Carousel from '../../../../../node_modules/bootstrap/js/src/carousel'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Carousel = Carousel; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const carousels = Joomla.getOptions('bootstrap.carousel'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/collapse.es6.js b/build/media_source/vendor/bootstrap/js/collapse.es6.js index 2a93ed2904dbf..e3443a089b23b 100644 --- a/build/media_source/vendor/bootstrap/js/collapse.es6.js +++ b/build/media_source/vendor/bootstrap/js/collapse.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Collapse from '../../../../../node_modules/bootstrap/js/src/collapse'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Collapse = Collapse; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const collapses = { ...Joomla.getOptions('bootstrap.collapse'), ...Joomla.getOptions('bootstrap.accordion') }; // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/dropdown.es6.js b/build/media_source/vendor/bootstrap/js/dropdown.es6.js index bfb9d694d7469..284df6c835f2c 100644 --- a/build/media_source/vendor/bootstrap/js/dropdown.es6.js +++ b/build/media_source/vendor/bootstrap/js/dropdown.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Dropdown from '../../../../../node_modules/bootstrap/js/src/dropdown'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Dropdown = Dropdown; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const dropdowns = Joomla.getOptions('bootstrap.dropdown'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/modal.es6.js b/build/media_source/vendor/bootstrap/js/modal.es6.js index d62c0d1c6734a..3a38354c17ca1 100644 --- a/build/media_source/vendor/bootstrap/js/modal.es6.js +++ b/build/media_source/vendor/bootstrap/js/modal.es6.js @@ -1,3 +1,4 @@ +import nojQueryMode from './nojquerymode.es6'; import Modal from '../../../../../node_modules/bootstrap/js/src/modal'; Joomla = Joomla || {}; @@ -133,12 +134,7 @@ Joomla.iframeButtonClick = (options) => { } }; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const modals = Joomla.getOptions('bootstrap.modal'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/nojquerymode.es6.js b/build/media_source/vendor/bootstrap/js/nojquerymode.es6.js new file mode 100644 index 0000000000000..20460c5f90b03 --- /dev/null +++ b/build/media_source/vendor/bootstrap/js/nojquerymode.es6.js @@ -0,0 +1,7 @@ +// Ensure vanilla mode, for consistency of the events +if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { + document.body.dataset.bsNoJquery = ''; +} +const nojQueryMode = true; + +export default nojQueryMode; diff --git a/build/media_source/vendor/bootstrap/js/popover.es6.js b/build/media_source/vendor/bootstrap/js/popover.es6.js index cee8694542296..1aed8a9a8f185 100644 --- a/build/media_source/vendor/bootstrap/js/popover.es6.js +++ b/build/media_source/vendor/bootstrap/js/popover.es6.js @@ -1,3 +1,4 @@ +import nojQueryMode from './nojquerymode.es6'; import Popover from '../../../../../node_modules/bootstrap/js/src/popover'; import Tooltip from '../../../../../node_modules/bootstrap/js/src/tooltip'; @@ -5,12 +6,7 @@ window.bootstrap = window.bootstrap || {}; window.bootstrap.Popover = Popover; window.bootstrap.Tooltip = Tooltip; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const tooltips = Joomla.getOptions('bootstrap.tooltip'); const popovers = Joomla.getOptions('bootstrap.popover'); diff --git a/build/media_source/vendor/bootstrap/js/scrollspy.es6.js b/build/media_source/vendor/bootstrap/js/scrollspy.es6.js index e6b79543cc8c4..8ddad7948d2e5 100644 --- a/build/media_source/vendor/bootstrap/js/scrollspy.es6.js +++ b/build/media_source/vendor/bootstrap/js/scrollspy.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Scrollspy from '../../../../../node_modules/bootstrap/js/src/scrollspy'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Scrollspy = Scrollspy; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const scrollspys = Joomla.getOptions('bootstrap.scrollspy'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/tab.es6.js b/build/media_source/vendor/bootstrap/js/tab.es6.js index 47215a81214e7..0e148f91517eb 100644 --- a/build/media_source/vendor/bootstrap/js/tab.es6.js +++ b/build/media_source/vendor/bootstrap/js/tab.es6.js @@ -1,3 +1,4 @@ +import nojQueryMode from './nojquerymode.es6'; import Tab from '../../../../../node_modules/bootstrap/js/src/tab'; window.Joomla = window.Joomla || {}; @@ -68,12 +69,7 @@ Joomla.initialiseTabs = (el, options) => { } }; -if (Joomla && Joomla.getOptions) { - // Ensure vanilla mode, for consistency of the events - if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; - } - +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const tabs = Joomla.getOptions('bootstrap.tabs'); // Initialise the elements diff --git a/build/media_source/vendor/bootstrap/js/toast.es6.js b/build/media_source/vendor/bootstrap/js/toast.es6.js index 845f5229c7fe6..d71639da8d731 100644 --- a/build/media_source/vendor/bootstrap/js/toast.es6.js +++ b/build/media_source/vendor/bootstrap/js/toast.es6.js @@ -1,14 +1,10 @@ +import nojQueryMode from './nojquerymode.es6'; import Toast from '../../../../../node_modules/bootstrap/js/src/toast'; window.bootstrap = window.bootstrap || {}; window.bootstrap.Toast = Toast; -// Ensure vanilla mode, for consistency of the events -if (!Object.prototype.hasOwnProperty.call(document.body.dataset, 'bsNoJquery')) { - document.body.dataset.bsNoJquery = ''; -} - -if (Joomla && Joomla.getOptions) { +if (nojQueryMode && Joomla && Joomla.getOptions) { // Get the elements/configurations from the PHP const toasts = Joomla.getOptions('bootstrap.toast'); // Initialise the elements