Changeset 56252
- Timestamp:
- 07/17/2023 10:01:08 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/vendor/farbtastic.js
r43309 r56252 1 1 /*! 2 2 * Farbtastic: jQuery color picker plug-in v1.3u 3 * https://github.com/mattfarina/farbtastic 3 4 * 4 5 * Licensed under the GPL license: 5 6 * http://www.gnu.org/licenses/gpl.html 6 7 */ 8 /** 9 * Modified for WordPress: replaced deprecated jQuery methods. 10 * See https://core.trac.wordpress.org/ticket/57946. 11 */ 12 7 13 (function($) { 8 14 … … 50 56 // Unbind previous nodes 51 57 if (typeof fb.callback == 'object') { 52 $(fb.callback). unbind('keyup', fb.updateValue);58 $(fb.callback).off('keyup', fb.updateValue); 53 59 } 54 60 … … 62 68 else if (typeof callback == 'object' || typeof callback == 'string') { 63 69 fb.callback = $(callback); 64 fb.callback. bind('keyup', fb.updateValue);70 fb.callback.on('keyup', fb.updateValue); 65 71 if (fb.callback.get(0).value) { 66 72 fb.setColor(fb.callback.get(0).value); … … 117 123 // Capture mouse 118 124 if (!document.dragging) { 119 $(document). bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);125 $(document).on('mousemove', fb.mousemove).on('mouseup', fb.mouseup); 120 126 document.dragging = true; 121 127 } … … 156 162 fb.mouseup = function () { 157 163 // Uncapture mouse 158 $(document). unbind('mousemove', fb.mousemove);159 $(document). unbind('mouseup', fb.mouseup);164 $(document).off('mousemove', fb.mousemove); 165 $(document).off('mouseup', fb.mouseup); 160 166 document.dragging = false; 161 167 }; … … 263 269 264 270 // Install mousedown handler (the others are set on the document on-demand) 265 $('*', e). mousedown(fb.mousedown);271 $('*', e).on('mousedown', fb.mousedown); 266 272 267 273 // Init color
Note: See TracChangeset
for help on using the changeset viewer.