Robin Herbots 8 years ago
parent
commit
ea3a54aab5

+ 3 - 3
js/dependencyLibs/inputmask.dependencyLib.jqlite.js

@@ -53,7 +53,7 @@
 		// hasOwn isn't used here due to false negatives
 		// regarding Nodelist length in IE
 		var length = "length" in obj && obj.length,
-			ltype = type(obj);
+			ltype = typeof obj;
 
 		if (ltype === "function" || isWindow(obj)) {
 			return false;
@@ -71,7 +71,7 @@
 		return arr == null ? -1 : indexOf(arr, elem, i);
 	};
 	$.isFunction = function (obj) {
-		return type(obj) === "function";
+		return typeof obj === "function";
 	};
 	$.isArray = Array.isArray;
 	$.isPlainObject = function (obj) {
@@ -79,7 +79,7 @@
 		// - Any object or value whose internal [[Class]] property is not "[object Object]"
 		// - DOM nodes
 		// - window
-		if (type(obj) !== "object" || obj.nodeType || isWindow(obj)) {
+		if (typeof obj !== "object" || obj.nodeType || isWindow(obj)) {
 			return false;
 		}
 

+ 4 - 20
js/dependencyLibs/inputmask.dependencyLib.js

@@ -30,22 +30,6 @@
         return -1;
     }
 
-    var class2type = {},
-        classTypes = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
-    for (var nameNdx = 0; nameNdx < classTypes.length; nameNdx++) {
-        class2type["[object " + classTypes[nameNdx] + "]"] = classTypes[nameNdx].toLowerCase();
-    }
-
-    function type(obj) {
-        if (obj == null) {
-            return obj + "";
-        }
-        // Support: Android<4.0, iOS<6 (functionish RegExp)
-        return typeof obj === "object" || typeof obj === "function" ?
-            class2type[class2type.toString.call(obj)] || "object" :
-            typeof obj;
-    }
-
     function isWindow(obj) {
         return obj != null && obj === obj.window;
     }
@@ -56,7 +40,7 @@
         // hasOwn isn't used here due to false negatives
         // regarding Nodelist length in IE
         var length = "length" in obj && obj.length,
-            ltype = type(obj);
+            ltype = typeof obj;
 
         if (ltype === "function" || isWindow(obj)) {
             return false;
@@ -259,7 +243,7 @@
 
     //static
     DependencyLib.isFunction = function (obj) {
-        return type(obj) === "function";
+        return typeof obj === "function";
     };
     DependencyLib.noop = function () {
     };
@@ -275,11 +259,11 @@
         // - Any object or value whose internal [[Class]] property is not "[object Object]"
         // - DOM nodes
         // - window
-        if (type(obj) !== "object" || obj.nodeType || isWindow(obj)) {
+        if (typeof obj !== "object" || obj.nodeType || isWindow(obj)) {
             return false;
         }
 
-        if (obj.constructor && !class2type.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
+        if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
             return false;
         }
 

+ 4 - 7
js/inputmask.js

@@ -2160,11 +2160,6 @@
                     inputValue = radixPointHandler(input, inputValue, caretPos);
                     inputValue = ieMobileHandler(input, inputValue, caretPos);
 
-                    // if (caretPos.begin > inputValue.length) {
-                    //     caret(input, inputValue.length);
-                    //     caretPos = caret(input);
-                    // }
-
                     if (getBuffer().join("") !== inputValue) {
                         var buffer = getBuffer().join(""),
                             offset = inputValue.length > buffer.length ? -1 : 0,
@@ -2197,8 +2192,6 @@
                                         selection.begin--;
                                         entries = opts.radixPoint;
                                     }
-
-
                                 }
                             }
                         }
@@ -2544,6 +2537,10 @@
 
             var range;
             if (begin !== undefined) {
+                if ($.isArray(begin)) {
+                    end = isRTL ? begin[0] : begin[1];
+                    begin = isRTL ? begin[1] : begin[0];
+                }
                 if (begin.begin !== undefined) {
                     end = isRTL ? begin.begin : begin.end;
                     begin = isRTL ? begin.end : begin.begin;