From c99c68b10f945abaf0c662dcc5a318aca1abc507 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 7 Oct 2020 09:33:18 -0400 Subject: [PATCH] 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();` --- ext/greenwich/greenwich.php | 3 +++ ext/greenwich/js/noConflict.js | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 ext/greenwich/js/noConflict.js 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); -- 2.25.1