|
|
@@ -3,7 +3,7 @@
|
|
|
* https://github.com/RobinHerbots/Inputmask
|
|
|
* Copyright (c) 2010 - 2017 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 4.0.1-12
|
|
|
+* Version: 4.0.1-13
|
|
|
*/
|
|
|
|
|
|
!function(factory) {
|
|
|
@@ -728,12 +728,14 @@
|
|
|
}
|
|
|
return document.body.removeChild(e), caretPos;
|
|
|
}
|
|
|
- var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);
|
|
|
+ function clickHandler(e) {
|
|
|
+ return input.focus(), caret(input, findCaretPos(e.clientX)), EventHandlers.clickEvent.call(input, [ e ]);
|
|
|
+ }
|
|
|
+ var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null), template = document.createElement("div");
|
|
|
colorMask = document.createElement("div"), colorMask.className = "im-colormask",
|
|
|
input.parentNode.insertBefore(colorMask, input), input.parentNode.removeChild(input),
|
|
|
- colorMask.appendChild(input), $(input).on("click", function(e) {
|
|
|
- return caret(input, findCaretPos(e.clientX)), EventHandlers.clickEvent.call(this, [ e ]);
|
|
|
- }), $(input).on("keydown", function(e) {
|
|
|
+ colorMask.appendChild(input), colorMask.appendChild(template), $(input).on("click", clickHandler),
|
|
|
+ $(template).on("click", clickHandler), $(input).on("keydown", function(e) {
|
|
|
e.shiftKey || !1 === opts.insertMode || setTimeout(function() {
|
|
|
renderColorMask(input);
|
|
|
}, 0);
|
|
|
@@ -762,9 +764,8 @@
|
|
|
} while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || "" !== test.def) || lvp > pos || isStatic);
|
|
|
-1 === maskTemplate.indexOf("im-caret") && handleCaret(!0), isStatic && handleStatic();
|
|
|
}
|
|
|
- var oldTemplate = colorMask.getElementsByTagName("div")[0], template = document.createElement("div");
|
|
|
- template.innerHTML = maskTemplate, oldTemplate && colorMask.removeChild(oldTemplate),
|
|
|
- colorMask.appendChild(template), input.inputmask.positionColorMask(input, template);
|
|
|
+ var template = colorMask.getElementsByTagName("div")[0];
|
|
|
+ template.innerHTML = maskTemplate, input.inputmask.positionColorMask(input, template);
|
|
|
}
|
|
|
}
|
|
|
maskset = maskset || this.maskset, opts = opts || this.opts;
|
|
|
@@ -1062,7 +1063,7 @@
|
|
|
}
|
|
|
};
|
|
|
Inputmask.prototype.positionColorMask = function(input, template) {
|
|
|
- template.style.left = input.offsetLeft + "px", template.zIndex = input.zIndex - 1;
|
|
|
+ template.style.left = input.offsetLeft + "px";
|
|
|
};
|
|
|
var valueBuffer;
|
|
|
if (actionObj !== undefined) switch (actionObj.action) {
|