Files
piratepoet/patches/spectrum-colorpicker@1.8.1.patch
Jan Jakes 6faa8e30e1 Use pnpm patch for spectrum-colorpicker deprecated jQuery methods
This patch replaces deprecated jQuery methods in the spectrum-colorpicker dependency.
It can be removed when a fix is included in a package update.
See: https://github.com/bgrins/spectrum/pull/564

[MAILPOET-4485]
2022-07-26 15:45:54 +02:00

31 lines
1.4 KiB
Diff

diff --git a/spectrum.js b/spectrum.js
index e2e068755fba7a86987a097bcf8f1def22ab10c4..6c48c12543a6ab611f5acc25ad5fd8d28b53dfd5 100644
--- a/spectrum.js
+++ b/spectrum.js
@@ -249,7 +249,7 @@
if (opts.palette) {
palette = opts.palette.slice(0);
- paletteArray = $.isArray(palette[0]) ? palette : [palette];
+ paletteArray = Array.isArray(palette[0]) ? palette : [palette];
paletteLookup = {};
for (var i = 0; i < paletteArray.length; i++) {
for (var j = 0; j < paletteArray[i].length; j++) {
@@ -321,14 +321,14 @@
}
// Prevent clicks from bubbling up to document. This would cause it to be hidden.
- container.click(stopPropagation);
+ container.on("click", stopPropagation);
// Handle user typed input
- textInput.change(setFromTextInput);
+ textInput.on("change", setFromTextInput);
textInput.on("paste", function () {
setTimeout(setFromTextInput, 1);
});
- textInput.keydown(function (e) { if (e.keyCode == 13) { setFromTextInput(); } });
+ textInput.on("keydown", function (e) { if (e.keyCode == 13) { setFromTextInput(); } });
cancelButton.text(opts.cancelText);
cancelButton.on("click.spectrum", function (e) {