Ticket #6438: 6438.patch
File 6438.patch, 1.7 KB (added by , 14 years ago) |
---|
-
_source/plugins/selection/plugin.js
249 249 }); 250 250 251 251 body.on( 'keydown', disableSave ); 252 body.on( 'keyup',253 254 255 256 257 });252 // Frequency control on the saving of selection when typing too fast. (#6438) 253 body.on( 'keyup', CKEDITOR.tools.periodical( 1000, function() 254 { 255 saveEnabled = true; 256 saveSelection(); 257 } )); 258 258 259 259 260 260 // IE is the only to provide the "selectionchange" -
_source/core/tools.js
459 459 milliseconds || 0 ); 460 460 }, 461 461 462 /* 463 * Make sure the passed function executes with at least {@param delay} of interval. 464 * @param delay The minimum period of time between two consequent function call. 465 * @param func The function on subject. 466 * @param [scope] The invocation scope of the passed function. 467 */ 468 periodical : function ( delay, func, scope ) 469 { 470 var timer, 471 args = Array.prototype.slice.call( arguments, 3 ); 472 return function () 473 { 474 !timer && ( timer = setTimeout( function () 475 { 476 clearTimeout( timer ); 477 timer = 0; 478 func.apply( scope, args ); 479 }, delay ) ); 480 }; 481 }, 482 462 483 /** 463 484 * Remove spaces from the start and the end of a string. The following 464 485 * characters are removed: space, tab, line break, line feed.