Browse Source

fix focus class

Robin Herbots 11 years ago
parent
commit
3234c9e2ef

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "jquery.inputmask",
     "name": "jquery.inputmask",
-    "version": "3.0.46",
+    "version": "3.0.47",
     "main": "./dist/jquery.inputmask.bundle.js",
     "main": "./dist/jquery.inputmask.bundle.js",
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"keywords" : ["jQuery", "plugins", "input", "form", "inputmask", "mask"],
 	"description": "jquery.inputmask is a jquery plugin which create an input 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.major = 3
 build.minor = 0
 build.minor = 0
-build.revision = 46
+build.revision = 47
 
 
 target = jquery.inputmask.bundle.js
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js
 target.min = jquery.inputmask.bundle.min.js

BIN
dist/jQuery.InputMask.3.0.45.nupkg


BIN
dist/jQuery.InputMask.3.0.46.nupkg


BIN
dist/jQuery.InputMask.3.0.47.nupkg


+ 18 - 18
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.0.46
+* Version: 3.0.47
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1196,7 +1196,7 @@
                 var keyupResult = opts.onKeyUp.call(this, e, buffer, opts);
                 var keyupResult = opts.onKeyUp.call(this, e, buffer, opts);
                 handleOnKeyResult(input, keyupResult, currentCaretPos);
                 handleOnKeyResult(input, keyupResult, currentCaretPos);
                 if (k == opts.keyCode.TAB && opts.showMaskOnFocus) {
                 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();
                         resetMaskSet();
                         buffer = getBuffer();
                         buffer = getBuffer();
                         writeBuffer(input, buffer);
                         writeBuffer(input, buffer);
@@ -1292,7 +1292,7 @@
 
 
                     //unbind all events - to make sure that no other mask will interfere when re-masking
                     //unbind all events - to make sure that no other mask will interfere when re-masking
                     $el.unbind(".inputmask");
                     $el.unbind(".inputmask");
-                    $el.removeClass('focus.inputmask');
+                    $el.removeClass('focus-inputmask');
                     //bind events
                     //bind events
                     $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('')) {
@@ -1305,7 +1305,7 @@
                     });
                     });
                     $el.bind("mouseenter.inputmask", function () {
                     $el.bind("mouseenter.inputmask", function () {
                         var $input = $(this), input = this;
                         var $input = $(this), input = this;
-                        if (!$input.hasClass('focus.inputmask') && opts.showMaskOnHover) {
+                        if (!$input.hasClass('focus-inputmask') && opts.showMaskOnHover) {
                             if (input._valueGet() != getBuffer().join('')) {
                             if (input._valueGet() != getBuffer().join('')) {
                                 writeBuffer(input, getBuffer());
                                 writeBuffer(input, getBuffer());
                             }
                             }
@@ -1314,7 +1314,7 @@
                         var $input = $(this), input = this;
                         var $input = $(this), input = this;
                         if ($input.data('_inputmask')) {
                         if ($input.data('_inputmask')) {
                             var nptValue = input._valueGet(), buffer = getBuffer();
                             var nptValue = input._valueGet(), buffer = getBuffer();
-                            $input.removeClass('focus.inputmask');
+                            $input.removeClass('focus-inputmask');
                             if (valueOnFocus != getBuffer().join('')) {
                             if (valueOnFocus != getBuffer().join('')) {
                                 $input.change();
                                 $input.change();
                             }
                             }
@@ -1340,17 +1340,17 @@
                         }
                         }
                     }).bind("focus.inputmask", function () {
                     }).bind("focus.inputmask", function () {
                         var $input = $(this), input = this, nptValue = input._valueGet();
                         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('')) {
                             if (input._valueGet() != getBuffer().join('')) {
                                 writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));
                                 writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));
                             }
                             }
                         }
                         }
-                        $input.addClass('focus.inputmask');
+                        $input.addClass('focus-inputmask');
                         valueOnFocus = getBuffer().join('');
                         valueOnFocus = getBuffer().join('');
                     }).bind("mouseleave.inputmask", function () {
                     }).bind("mouseleave.inputmask", function () {
                         var $input = $(this), input = this;
                         var $input = $(this), input = this;
                         if (opts.clearMaskOnLostFocus) {
                         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() == '')
                                 if (input._valueGet() == getBufferTemplate().join('') || input._valueGet() == '')
                                     input._valueSet('');
                                     input._valueSet('');
                                 else { //clearout optional tail of the mask
                                 else { //clearout optional tail of the mask
@@ -1417,7 +1417,7 @@
                     } catch (e) {
                     } catch (e) {
                     }
                     }
                     if (activeElement === el) { //position the caret when in focus
                     if (activeElement === el) { //position the caret when in focus
-                        $el.addClass('focus.inputmask');
+                        $el.addClass('focus-inputmask');
                         caret(el, seekNext(getLastValidPosition()));
                         caret(el, seekNext(getLastValidPosition()));
                     } else {
                     } else {
                         if (isComplete(getBuffer()) === false) {
                         if (isComplete(getBuffer()) === false) {
@@ -1501,7 +1501,7 @@
                         el._valueSet(unmaskedvalue($el));
                         el._valueSet(unmaskedvalue($el));
                         //unbind all events
                         //unbind all events
                         $el.unbind(".inputmask");
                         $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
+                        $el.removeClass('focus-inputmask');
                         //clear data
                         //clear data
                         $el.removeData('_inputmask');
                         $el.removeData('_inputmask');
                         //restore the value property
                         //restore the value property
@@ -1726,7 +1726,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.0.46
+* Version: 3.0.47
 */
 */
 
 
 (function ($) {
 (function ($) {
@@ -1869,7 +1869,7 @@
                     el.value = value;
                     el.value = value;
                 }
                 }
                 if ($.inArray(eventType, ["blur", "focus"]) == -1) {
                 if ($.inArray(eventType, ["blur", "focus"]) == -1) {
-                    if ($(elmasks[activeMasksetIndex]).hasClass("focus.inputmask")) {
+                    if ($(elmasks[activeMasksetIndex]).hasClass("focus-inputmask")) {
                         var activeCaret = mcaret(elmasks[activeMasksetIndex]);
                         var activeCaret = mcaret(elmasks[activeMasksetIndex]);
                         mcaret(el, activeCaret.begin, activeCaret.end);
                         mcaret(el, activeCaret.begin, activeCaret.end);
                     }
                     }
@@ -2030,7 +2030,7 @@
                         el._valueSet(unmaskedvalue($el));
                         el._valueSet(unmaskedvalue($el));
                         //unbind all events
                         //unbind all events
                         $el.unbind(".inputmask");
                         $el.unbind(".inputmask");
-                        $el.removeClass('focus.inputmask');
+                        $el.removeClass('focus-inputmask');
                         //clear data
                         //clear data
                         $el.removeData('_inputmask');
                         $el.removeData('_inputmask');
                         //restore the value property
                         //restore the value property
@@ -2089,7 +2089,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.0.46
+Version: 3.0.47
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2210,7 +2210,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.0.46
+Version: 3.0.47
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2673,7 +2673,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.0.46
+Version: 3.0.47
 
 
 Optional extensions on the jquery.inputmask base
 Optional extensions on the jquery.inputmask base
 */
 */
@@ -2908,7 +2908,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.0.46
+Version: 3.0.47
 
 
 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
@@ -3095,7 +3095,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.0.46
+Version: 3.0.47
 
 
 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
+ 10 - 10
dist/jquery.inputmask.bundle.min.js


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


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


+ 1 - 1
jquery.inputmask.jquery.json

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

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

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

+ 9 - 9
js/jquery.inputmask.js

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