浏览代码

fix focus class

Robin Herbots 11 年之前
父节点
当前提交
3234c9e2ef

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "3.0.46",
+    "version": "3.0.47",
     "main": "./dist/jquery.inputmask.bundle.js",
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"description": "jquery.inputmask is a jquery plugin which create an input mask.",

+ 1 - 1
build.properties

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

二进制
dist/jQuery.InputMask.3.0.45.nupkg


二进制
dist/jQuery.InputMask.3.0.46.nupkg


二进制
dist/jQuery.InputMask.3.0.47.nupkg


+ 18 - 18
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.46
+* Version: 3.0.47
 */
 
 (function ($) {
@@ -1196,7 +1196,7 @@
                 var keyupResult = opts.onKeyUp.call(this, e, buffer, opts);
                 handleOnKeyResult(input, keyupResult, currentCaretPos);
                 if (k == opts.keyCode.TAB && opts.showMaskOnFocus) {
-                    if ($input.hasClass('focus.inputmask') && input._valueGet().length == 0) {
+                    if ($input.hasClass('focus-inputmask') && input._valueGet().length == 0) {
                         resetMaskSet();
                         buffer = getBuffer();
                         writeBuffer(input, buffer);
@@ -1292,7 +1292,7 @@
 
                     //unbind all events - to make sure that no other mask will interfere when re-masking
                     $el.unbind(".inputmask");
-                    $el.removeClass('focus.inputmask');
+                    $el.removeClass('focus-inputmask');
                     //bind events
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                         if (valueOnFocus != getBuffer().join('')) {
@@ -1305,7 +1305,7 @@
                     });
                     $el.bind("mouseenter.inputmask", function () {
                         var $input = $(this), input = this;
-                        if (!$input.hasClass('focus.inputmask') && opts.showMaskOnHover) {
+                        if (!$input.hasClass('focus-inputmask') && opts.showMaskOnHover) {
                             if (input._valueGet() != getBuffer().join('')) {
                                 writeBuffer(input, getBuffer());
                             }
@@ -1314,7 +1314,7 @@
                         var $input = $(this), input = this;
                         if ($input.data('_inputmask')) {
                             var nptValue = input._valueGet(), buffer = getBuffer();
-                            $input.removeClass('focus.inputmask');
+                            $input.removeClass('focus-inputmask');
                             if (valueOnFocus != getBuffer().join('')) {
                                 $input.change();
                             }
@@ -1340,17 +1340,17 @@
                         }
                     }).bind("focus.inputmask", function () {
                         var $input = $(this), input = this, nptValue = input._valueGet();
-                        if (opts.showMaskOnFocus && !$input.hasClass('focus.inputmask') && (!opts.showMaskOnHover || (opts.showMaskOnHover && nptValue == ''))) {
+                        if (opts.showMaskOnFocus && !$input.hasClass('focus-inputmask') && (!opts.showMaskOnHover || (opts.showMaskOnHover && nptValue == ''))) {
                             if (input._valueGet() != getBuffer().join('')) {
                                 writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));
                             }
                         }
-                        $input.addClass('focus.inputmask');
+                        $input.addClass('focus-inputmask');
                         valueOnFocus = getBuffer().join('');
                     }).bind("mouseleave.inputmask", function () {
                         var $input = $(this), input = this;
                         if (opts.clearMaskOnLostFocus) {
-                            if (!$input.hasClass('focus.inputmask') && input._valueGet() != $input.attr("placeholder")) {
+                            if (!$input.hasClass('focus-inputmask') && input._valueGet() != $input.attr("placeholder")) {
                                 if (input._valueGet() == getBufferTemplate().join('') || input._valueGet() == '')
                                     input._valueSet('');
                                 else { //clearout optional tail of the mask
@@ -1417,7 +1417,7 @@
                     } catch (e) {
                     }
                     if (activeElement === el) { //position the caret when in focus
-                        $el.addClass('focus.inputmask');
+                        $el.addClass('focus-inputmask');
                         caret(el, seekNext(getLastValidPosition()));
                     } else {
                         if (isComplete(getBuffer()) === false) {
@@ -1501,7 +1501,7 @@
                         el._valueSet(unmaskedvalue($el));
                         //unbind all events
                         $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
+                        $el.removeClass('focus-inputmask');
                         //clear data
                         $el.removeData('_inputmask');
                         //restore the value property
@@ -1726,7 +1726,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.0.46
+* Version: 3.0.47
 */
 
 (function ($) {
@@ -1869,7 +1869,7 @@
                     el.value = value;
                 }
                 if ($.inArray(eventType, ["blur", "focus"]) == -1) {
-                    if ($(elmasks[activeMasksetIndex]).hasClass("focus.inputmask")) {
+                    if ($(elmasks[activeMasksetIndex]).hasClass("focus-inputmask")) {
                         var activeCaret = mcaret(elmasks[activeMasksetIndex]);
                         mcaret(el, activeCaret.begin, activeCaret.end);
                     }
@@ -2030,7 +2030,7 @@
                         el._valueSet(unmaskedvalue($el));
                         //unbind all events
                         $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
+                        $el.removeClass('focus-inputmask');
                         //clear data
                         $el.removeData('_inputmask');
                         //restore the value property
@@ -2089,7 +2089,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.46
+Version: 3.0.47
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2210,7 +2210,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.46
+Version: 3.0.47
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2673,7 +2673,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.46
+Version: 3.0.47
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2908,7 +2908,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.46
+Version: 3.0.47
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -3095,7 +3095,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2014 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 3.0.46
+Version: 3.0.47
 
 Phone extension.
 When using this extension make sure you specify the correct url to get the masks

文件差异内容过多而无法显示
+ 10 - 10
dist/jquery.inputmask.bundle.min.js


文件差异内容过多而无法显示
+ 3 - 3
dist/min/jquery.inputmask-multi.js


文件差异内容过多而无法显示
+ 7 - 7
dist/min/jquery.inputmask.js


+ 1 - 1
jquery.inputmask.jquery.json

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

+ 2 - 2
js/jquery.inputmask-multi.js

@@ -146,7 +146,7 @@
                     el.value = value;
                 }
                 if ($.inArray(eventType, ["blur", "focus"]) == -1) {
-                    if ($(elmasks[activeMasksetIndex]).hasClass("focus.inputmask")) {
+                    if ($(elmasks[activeMasksetIndex]).hasClass("focus-inputmask")) {
                         var activeCaret = mcaret(elmasks[activeMasksetIndex]);
                         mcaret(el, activeCaret.begin, activeCaret.end);
                     }
@@ -307,7 +307,7 @@
                         el._valueSet(unmaskedvalue($el));
                         //unbind all events
                         $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
+                        $el.removeClass('focus-inputmask');
                         //clear data
                         $el.removeData('_inputmask');
                         //restore the value property

+ 9 - 9
js/jquery.inputmask.js

@@ -1196,7 +1196,7 @@
                 var keyupResult = opts.onKeyUp.call(this, e, buffer, opts);
                 handleOnKeyResult(input, keyupResult, currentCaretPos);
                 if (k == opts.keyCode.TAB && opts.showMaskOnFocus) {
-                    if ($input.hasClass('focus.inputmask') && input._valueGet().length == 0) {
+                    if ($input.hasClass('focus-inputmask') && input._valueGet().length == 0) {
                         resetMaskSet();
                         buffer = getBuffer();
                         writeBuffer(input, buffer);
@@ -1292,7 +1292,7 @@
 
                     //unbind all events - to make sure that no other mask will interfere when re-masking
                     $el.unbind(".inputmask");
-                    $el.removeClass('focus.inputmask');
+                    $el.removeClass('focus-inputmask');
                     //bind events
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                         if (valueOnFocus != getBuffer().join('')) {
@@ -1305,7 +1305,7 @@
                     });
                     $el.bind("mouseenter.inputmask", function () {
                         var $input = $(this), input = this;
-                        if (!$input.hasClass('focus.inputmask') && opts.showMaskOnHover) {
+                        if (!$input.hasClass('focus-inputmask') && opts.showMaskOnHover) {
                             if (input._valueGet() != getBuffer().join('')) {
                                 writeBuffer(input, getBuffer());
                             }
@@ -1314,7 +1314,7 @@
                         var $input = $(this), input = this;
                         if ($input.data('_inputmask')) {
                             var nptValue = input._valueGet(), buffer = getBuffer();
-                            $input.removeClass('focus.inputmask');
+                            $input.removeClass('focus-inputmask');
                             if (valueOnFocus != getBuffer().join('')) {
                                 $input.change();
                             }
@@ -1340,17 +1340,17 @@
                         }
                     }).bind("focus.inputmask", function () {
                         var $input = $(this), input = this, nptValue = input._valueGet();
-                        if (opts.showMaskOnFocus && !$input.hasClass('focus.inputmask') && (!opts.showMaskOnHover || (opts.showMaskOnHover && nptValue == ''))) {
+                        if (opts.showMaskOnFocus && !$input.hasClass('focus-inputmask') && (!opts.showMaskOnHover || (opts.showMaskOnHover && nptValue == ''))) {
                             if (input._valueGet() != getBuffer().join('')) {
                                 writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));
                             }
                         }
-                        $input.addClass('focus.inputmask');
+                        $input.addClass('focus-inputmask');
                         valueOnFocus = getBuffer().join('');
                     }).bind("mouseleave.inputmask", function () {
                         var $input = $(this), input = this;
                         if (opts.clearMaskOnLostFocus) {
-                            if (!$input.hasClass('focus.inputmask') && input._valueGet() != $input.attr("placeholder")) {
+                            if (!$input.hasClass('focus-inputmask') && input._valueGet() != $input.attr("placeholder")) {
                                 if (input._valueGet() == getBufferTemplate().join('') || input._valueGet() == '')
                                     input._valueSet('');
                                 else { //clearout optional tail of the mask
@@ -1417,7 +1417,7 @@
                     } catch (e) {
                     }
                     if (activeElement === el) { //position the caret when in focus
-                        $el.addClass('focus.inputmask');
+                        $el.addClass('focus-inputmask');
                         caret(el, seekNext(getLastValidPosition()));
                     } else {
                         if (isComplete(getBuffer()) === false) {
@@ -1501,7 +1501,7 @@
                         el._valueSet(unmaskedvalue($el));
                         //unbind all events
                         $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
+                        $el.removeClass('focus-inputmask');
                         //clear data
                         $el.removeData('_inputmask');
                         //restore the value property