Skip to content

Instantly share code, notes, and snippets.

@esedic
Created November 17, 2015 22:42
Show Gist options
  • Save esedic/b925ce0f8680279e1493 to your computer and use it in GitHub Desktop.
Save esedic/b925ce0f8680279e1493 to your computer and use it in GitHub Desktop.
Fix Mootools conflicts with Bootstrap Joomla templates when you use an extension that requires Mootools
/*
* Add missing Mootools when Bootstrap is loaded
* This fix creates dummy implementations for the missing Mootools functions.
* It requires that you have jQuery loaded and if you are dealing with Mootools + jQuery is a good idea to add the call just before this javascript code.
* This issue shouldn't affect Bootstrap 3 templates but the fix explained here should be compatible with both.
*/
(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;
}
});
}
});
})(jQuery);
@hiteshaggarwal
Copy link

Thanks Elvis for this useful script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment