I use t4-bs5-blank template on a Joomla 5 website that has a plugin that currently still uses mootools. I have found that the T4 Framework has a JavaScript file: ~/plugins/system/t4/themes/base/js/base.js which has a section of code:
// Add missing Mootools when Bootstrap is loaded
(function($)
{
$(document).ready(function(){
var bootstrapLoaded = (typeof $().carousel == 'function');
var mootoolsLoaded = (typeof MooTools != 'undefined');
if (bootstrapLoaded && mootoolsLoaded ) {
Element.implement({
hide: function () {
return this;
},
show: function (v) {
return this;
},
slide: function (v) {
return this;
}
});
}
});
This implementation of empty Element show(). hide() is replacing the implementations that come with the plugin. I have worked around this by changing the above code to:
// Add missing Mootools when Bootstrap is loaded if not already defined
(function($)
{
$(document).ready(function(){
var bootstrapLoaded = (typeof $().carousel == 'function');
var mootoolsLoaded = (typeof MooTools != 'undefined');
var mootoolsShowDefined = (typeof Element.show === "function");
if (bootstrapLoaded && mootoolsLoaded && !mootoolsShowDefined) {
Element.implement({
hide: function () {
return this;
},
show: function (v) {
return this;
},
slide: function (v) {
return this;
}
});
}
});
Not sure if there is somewhere I can place this code in some custom file to avoid it being overwritten on the next T4-Framework update, or if something similar could be considered for the next release?