Update spectrum-colorpicker [MAILPOET-3386]
The deprecated jQuery methods are fixed in GitHub, but not in npm, so I've decided to apply a patch from the repo until it gets released.
This commit is contained in:
48
tasks/patches/spectrum-replace-jquery-deprecated.patch
Normal file
48
tasks/patches/spectrum-replace-jquery-deprecated.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From 8fd0a3a5f6a478f319763f999aaf5d8531c52b1d Mon Sep 17 00:00:00 2001
|
||||
From: Anders Kaseorg <andersk@mit.edu>
|
||||
Date: Tue, 21 Jul 2020 20:52:17 -0700
|
||||
Subject: [PATCH] Replace deprecated jQuery methods
|
||||
|
||||
Fixes these warnings from jquery-migrate:
|
||||
|
||||
JQMIGRATE: jQuery.isArray is deprecated; use Array.isArray
|
||||
JQMIGRATE: jQuery.fn.click() event shorthand is deprecated
|
||||
JQMIGRATE: jQuery.fn.change() event shorthand is deprecated
|
||||
JQMIGRATE: jQuery.fn.keydown() event shorthand is deprecated
|
||||
|
||||
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
||||
---
|
||||
node_modules/spectrum-colorpicker/spectrum.js | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/node_modules/spectrum-colorpicker/spectrum.js b/node_modules/spectrum-colorpicker/spectrum.js
|
||||
index e2e0687..6c48c12 100644
|
||||
--- a/node_modules/spectrum-colorpicker/spectrum.js
|
||||
+++ b/node_modules/spectrum-colorpicker/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) {
|
Reference in New Issue
Block a user