Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 1a2aa11

Browse files
1.8.3
1 parent 313e19c commit 1a2aa11

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

dist/mask.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* angular-ui-mask
33
* https://github.com/angular-ui/ui-mask
4-
* Version: 1.8.2 - 2016-03-17T13:37:16.675Z
4+
* Version: 1.8.3 - 2016-03-30T21:12:43.955Z
55
* License: MIT
66
*/
77

@@ -20,12 +20,16 @@ angular.module('ui.mask', [])
2020
},
2121
clearOnBlur: true,
2222
clearOnBlurPlaceholder: false,
23+
escChar: '\\',
2324
eventsToHandle: ['input', 'keyup', 'click', 'focus'],
2425
addDefaultPlaceholder: true
2526
})
2627
.provider('uiMask.Config', function() {
2728
var options = {};
2829

30+
this.maskDefinitions = function(maskDefinitions) {
31+
return options.maskDefinitions = maskDefinitions;
32+
};
2933
this.clearOnBlur = function(clearOnBlur) {
3034
return options.clearOnBlur = clearOnBlur;
3135
};
@@ -40,9 +44,12 @@ angular.module('ui.mask', [])
4044
};
4145
this.$get = ['uiMaskConfig', function(uiMaskConfig) {
4246
var tempOptions = uiMaskConfig;
43-
for(var prop in options)
44-
{
45-
tempOptions[prop] = options[prop];
47+
for(var prop in options) {
48+
if (angular.isObject(options[prop]) && !angular.isArray(options[prop])) {
49+
angular.extend(tempOptions[prop], options[prop]);
50+
} else {
51+
tempOptions[prop] = options[prop];
52+
}
4653
}
4754

4855
return tempOptions;
@@ -383,9 +390,17 @@ angular.module('ui.mask', [])
383390
numberOfOptionalCharacters = 0,
384391
splitMask = mask.split('');
385392

393+
var inEscape = false;
386394
angular.forEach(splitMask, function(chr, i) {
387-
if (linkOptions.maskDefinitions[chr]) {
388-
395+
if (inEscape) {
396+
inEscape = false;
397+
maskPlaceholder += chr;
398+
characterCount++;
399+
}
400+
else if (linkOptions.escChar === chr) {
401+
inEscape = true;
402+
}
403+
else if (linkOptions.maskDefinitions[chr]) {
389404
maskCaretMap.push(characterCount);
390405

391406
maskPlaceholder += getPlaceholderChar(i - numberOfOptionalCharacters);

dist/mask.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ui-mask",
3-
"version": "1.8.2",
3+
"version": "1.8.3",
44
"author": "https://github.com/angular-ui/ui-mask/graphs/contributors",
55
"license": "MIT",
66
"homepage": "https://github.com/angular-ui/ui-mask",

0 commit comments

Comments
 (0)