From: Coleman Watts Date: Wed, 7 Oct 2020 13:33:18 +0000 (-0400) Subject: Greenwich - fix conflict btw bootstrap & jQuery UI button X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c99c68b10f945abaf0c662dcc5a318aca1abc507;p=civicrm-core.git Greenwich - fix conflict btw bootstrap & jQuery UI button This calls noConflict on the Bootstrap3 $.fn.button() method, essentially getting rid of it, as it is not used by CiviCRM, whereas the jQuery UI $.fn.button() is used. If we needed the boostrap button function, we could rename it with something like: `$.fn.btn = $.fn.button.noConflict();` --- diff --git a/ext/greenwich/greenwich.php b/ext/greenwich/greenwich.php index 14c312e0a2..3f4ffc0b89 100644 --- a/ext/greenwich/greenwich.php +++ b/ext/greenwich/greenwich.php @@ -56,6 +56,9 @@ function greenwich_civicrm_alterBundle(CRM_Core_Resources_Bundle $bundle) { $bundle->addScriptFile('greenwich', 'extern/bootstrap3/assets/javascripts/bootstrap.min.js', [ 'translate' => FALSE, ]); + $bundle->addScriptFile('greenwich', 'js/noConflict.js', [ + 'translate' => FALSE, + ]); break; } } diff --git a/ext/greenwich/js/noConflict.js b/ext/greenwich/js/noConflict.js new file mode 100644 index 0000000000..ba41900413 --- /dev/null +++ b/ext/greenwich/js/noConflict.js @@ -0,0 +1,4 @@ +// https://civicrm.org/licensing +(function($) { + $.fn.button.noConflict(); +})(jQuery);