Created
November 17, 2015 22:42
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Elvis for this useful script.