Browse Source

Merge pull request #2084 from SmartBillCloud/4.x

Fix memory leak by moving the "positionColorMask" declaration outside of function scope
Robin Herbots 6 years ago
parent
commit
73aa85251e
1 changed files with 3 additions and 4 deletions
  1. 3 4
      js/inputmask.js

+ 3 - 4
js/inputmask.js

@@ -633,6 +633,9 @@ Inputmask.prototype = {
         }
         }
         // console.log(JSON.stringify(maskTokens));
         // console.log(JSON.stringify(maskTokens));
         return maskTokens;
         return maskTokens;
+    },
+    positionColorMask: function (input, template) {
+        input.style.left = template.offsetLeft + "px";
     }
     }
 };
 };
 
 
@@ -2809,10 +2812,6 @@ function maskScope(actionObj, maskset, opts) {
         });
         });
     }
     }
 
 
-    Inputmask.prototype.positionColorMask = function (input, template) {
-        input.style.left = template.offsetLeft + "px";
-    }
-
     function renderColorMask(input, caretPos, clear) {
     function renderColorMask(input, caretPos, clear) {
         var maskTemplate = [],
         var maskTemplate = [],
             isStatic = false,
             isStatic = false,