Browse Source

fix form reset #298

Robin Herbots 12 years ago
parent
commit
09455a554a

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 2
 build.minor = 3
-build.revision = 13
+build.revision = 14
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "2.3.13",
+    "version": "2.3.14",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
         "jquery": ">=1.5"

BIN
dist/jQuery.InputMask.2.3.14.nupkg


+ 11 - 5
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.3.13
+* Version: 2.3.14
 */
 
 (function ($) {
@@ -850,6 +850,12 @@
                         if ($input[0]._valueGet && $input[0]._valueGet() != getActiveMaskSet()["undoBuffer"]) {
                             $input.change();
                         }
+                    }).bind('reset', function () {
+                        $.each(masksets, function (ndx, ms) {
+                            ms["buffer"] = ms["_buffer"].slice();
+                            ms["lastValidPosition"] = undefined;
+                            ms["p"] = -1;
+                        });
                     });
                     $input.bind("mouseenter.inputmask", function () {
                         var $input = $(this), input = this;
@@ -1514,7 +1520,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.13
+Version: 2.3.14
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1616,7 +1622,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.13
+Version: 2.3.14
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2093,7 +2099,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.13
+Version: 2.3.14
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2260,7 +2266,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.3.13
+Version: 2.3.14
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

File diff suppressed because it is too large
+ 64 - 64
dist/jquery.inputmask.bundle.min.js


File diff suppressed because it is too large
+ 42 - 42
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"mask"
     ],
-    "version": "2.3.13",
+    "version": "2.3.14",
     "author": {
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 6 - 0
js/jquery.inputmask.js

@@ -850,6 +850,12 @@
                         if ($input[0]._valueGet && $input[0]._valueGet() != getActiveMaskSet()["undoBuffer"]) {
                             $input.change();
                         }
+                    }).bind('reset', function () {
+                        $.each(masksets, function (ndx, ms) {
+                            ms["buffer"] = ms["_buffer"].slice();
+                            ms["lastValidPosition"] = undefined;
+                            ms["p"] = -1;
+                        });
                     });
                     $input.bind("mouseenter.inputmask", function () {
                         var $input = $(this), input = this;