diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2021-09-03 14:42:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-03 14:42:30 +0200 |
commit | 2fd224d5cc3ac7ce37e3e60e4d28e19f89321dcd (patch) | |
tree | 44f8f77bd2d304a90fa87a2ae32fc6db7008bd3a /ui/jquery-var-for-color.js | |
parent | eda9f3b0d6676df900764da11124d688dec0b007 (diff) | |
download | jquery-ui-2fd224d5cc3ac7ce37e3e60e4d28e19f89321dcd.tar.gz jquery-ui-2fd224d5cc3ac7ce37e3e60e4d28e19f89321dcd.zip |
Effect: Define the jQuery variable before jQuery Color gets imported
We need to create a local jQuery because jQuery Color relies on it and the
global may not exist with AMD and a custom build (trac-10199). This worked
in UI 1.12 but stopped in 1.13 as jQuery Color is now sourced as an AMD module
and the variable started being defined after jQuery Color code. To restore the
proper order, move the variable declaration to a separate small module loaded
before jQuery Color.
Closes gh-1973
Diffstat (limited to 'ui/jquery-var-for-color.js')
-rw-r--r-- | ui/jquery-var-for-color.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/jquery-var-for-color.js b/ui/jquery-var-for-color.js new file mode 100644 index 000000000..f37ed56da --- /dev/null +++ b/ui/jquery-var-for-color.js @@ -0,0 +1,22 @@ +( function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "jquery", "./version" ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +} )( function( $ ) { + "use strict"; + +// Create a local jQuery because jQuery Color relies on it and the +// global may not exist with AMD and a custom build (#10199). +// This module is a noop if used as a regular AMD module. +// eslint-disable-next-line no-unused-vars +var jQuery = $; + +} ); |