Browse Source

allow global options with -data attributes

Robin Herbots 12 years ago
parent
commit
f4a03d7209

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 2
 build.minor = 2
-build.revision = 39
+build.revision = 40
 
 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.2.39",
+    "version": "2.2.40",
     "main": "./js/jquery.inputmask.js",
     "dependencies": {
         "jquery": ">=1.5"

BIN
dist/jQuery.InputMask.2.2.39.nupkg


BIN
dist/jQuery.InputMask.2.2.40.nupkg


+ 8 - 7
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.2.39
+* Version: 2.2.40
 */
 
 (function ($) {
@@ -191,9 +191,10 @@
                     if (attrOptions && attrOptions != "") {
                         try {
                             attrOptions = attrOptions.replace(new RegExp("'", "g"), '"');
-                            var options = $.parseJSON("{" + attrOptions + "}");
+                            var dataoptions = $.parseJSON("{" + attrOptions + "}");
                             opts = $.extend(true, {}, $.inputmask.defaults, options);
-                            resolveAlias(opts.alias, options);
+                            $.extend(true, opts, dataoptions);
+                            resolveAlias(opts.alias, dataoptions);
                             opts.alias = undefined;
                             $(this).inputmask(opts);
                         } catch (ex) { } //need a more relax parseJSON
@@ -1465,7 +1466,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.2.39
+Version: 2.2.40
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1566,7 +1567,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.2.39
+Version: 2.2.40
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2059,7 +2060,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.2.39
+Version: 2.2.40
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2221,7 +2222,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.2.39
+Version: 2.2.40
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 3 - 2
js/jquery.inputmask.js

@@ -191,9 +191,10 @@
                     if (attrOptions && attrOptions != "") {
                         try {
                             attrOptions = attrOptions.replace(new RegExp("'", "g"), '"');
-                            var options = $.parseJSON("{" + attrOptions + "}");
+                            var dataoptions = $.parseJSON("{" + attrOptions + "}");
                             opts = $.extend(true, {}, $.inputmask.defaults, options);
-                            resolveAlias(opts.alias, options);
+                            $.extend(true, opts, dataoptions);
+                            resolveAlias(opts.alias, dataoptions);
                             opts.alias = undefined;
                             $(this).inputmask(opts);
                         } catch (ex) { } //need a more relax parseJSON