Ticket #57946: 57946.1.patch
File 57946.1.patch, 2.0 KB (added by , 14 months ago) |
---|
-
src/js/_enqueues/vendor/farbtastic.js
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 9 15 $.fn.farbtastic = function (options) { … … 49 55 fb.linkTo = function (callback) { 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 55 61 // Reset color … … 61 67 } 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); 67 73 } … … 116 122 fb.mousedown = function (event) { 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 } 122 128 … … 155 161 */ 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 }; 162 168 … … 262 268 }; 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 268 274 fb.setColor('#000000');