diff options
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js index ea1dd1847..035c59da0 100644 --- a/js/util.js +++ b/js/util.js @@ -85,6 +85,19 @@ var SN = { // StatusNet SN.U.Counter(form); }); + var delayedUpdate= function(e) { + // Cut and paste events fire *before* the operation, + // so we need to trigger an update in a little bit. + // This would be so much easier if the 'change' event + // actually fired every time the value changed. :P + window.setTimeout(function() { + SN.U.Counter(form); + }, 50); + }; + // Note there's still no event for mouse-triggered 'delete'. + NDT.bind('cut', delayedUpdate) + .bind('paste', delayedUpdate); + NDT.bind('keydown', function(e) { SN.U.SubmitOnReturn(e, form); }); |