From 9373aff4f84cd678691e14f263128e2cb3c74016 Mon Sep 17 00:00:00 2001 From: urosg Date: Mon, 26 Nov 2012 23:10:05 +0100 Subject: [PATCH] Update numeric/jquery.numeric.js corrected removeNumeric() function as it didn't unbind all events and didn't remove the data / just nulled it. --- numeric/jquery.numeric.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/numeric/jquery.numeric.js b/numeric/jquery.numeric.js index 417f26c..140f561 100644 --- a/numeric/jquery.numeric.js +++ b/numeric/jquery.numeric.js @@ -238,7 +238,13 @@ $.fn.numeric.blur = function() $.fn.removeNumeric = function() { - return this.data("numeric.decimal", null).data("numeric.negative", null).data("numeric.callback", null).unbind("keypress", $.fn.numeric.keypress).unbind("blur", $.fn.numeric.blur); + return this + .removeData('numeric.decimal') + .removeData('numeric.negative') + .removeData('numeric.callback') + .unbind('keypress', $.fn.numeric.keypress) + .unbind('blur', $.fn.numeric.blur) + .unbind('keyup', $.fn.numeric.keyup); }; // Based on code from http://javascript.nwbox.com/cursor_position/ (Diego Perini )