Browse Source

enhance form submit handling #619 #624

Robin Herbots 11 years ago
parent
commit
626c7042d5

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "jquery.inputmask",
   "name": "jquery.inputmask",
-  "version": "3.1.3",
+  "version": "3.1.4",
   "main": [
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",

+ 1 - 1
build.properties

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

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


+ 9 - 7
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.3
+* Version: 3.1.4
 */
 */
 
 
 (function (factory) {
 (function (factory) {
@@ -1511,8 +1511,10 @@
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                         if (valueOnFocus != getBuffer().join('')) {
                         if (valueOnFocus != getBuffer().join('')) {
                             $el.change();
                             $el.change();
-                        } else if ($el[0]._valueGet() == getBufferTemplate().join(''))
+                        }
+                        if ($el[0]._valueGet() == getBufferTemplate().join('')) {
                             $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
                             $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
+                        }
                         if (opts.autoUnmask && opts.removeMaskOnSubmit) {
                         if (opts.autoUnmask && opts.removeMaskOnSubmit) {
                             $el.inputmask("remove");
                             $el.inputmask("remove");
                         }
                         }
@@ -1977,7 +1979,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.1.3
+Version: 3.1.4
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2105,7 +2107,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.1.3
+Version: 3.1.4
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2601,7 +2603,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.1.3
+Version: 3.1.4
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2861,7 +2863,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.1.3
+Version: 3.1.4
 
 
 Regex extensions on the jquery.inputmask base
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
 Allows for using regular expressions as a mask
@@ -3055,7 +3057,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.1.3
+Version: 3.1.4
 
 
 Phone extension.
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks
 When using this extension make sure you specify the correct url to get the masks

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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 3 - 1
js/jquery.inputmask.js

@@ -1511,8 +1511,10 @@
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                         if (valueOnFocus != getBuffer().join('')) {
                         if (valueOnFocus != getBuffer().join('')) {
                             $el.change();
                             $el.change();
-                        } else if ($el[0]._valueGet() == getBufferTemplate().join(''))
+                        }
+                        if ($el[0]._valueGet() == getBufferTemplate().join('')) {
                             $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
                             $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
+                        }
                         if (opts.autoUnmask && opts.removeMaskOnSubmit) {
                         if (opts.autoUnmask && opts.removeMaskOnSubmit) {
                             $el.inputmask("remove");
                             $el.inputmask("remove");
                         }
                         }

File diff suppressed because it is too large
+ 617 - 0
js/phone-codes/phone-uk.json


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "jquery.inputmask",
   "name": "jquery.inputmask",
-  "version": "3.1.3",
+  "version": "3.1.4",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": [
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.js",