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

Commit f3cd452

Browse files
1.8.2
1 parent 7cdb4b5 commit f3cd452

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

dist/mask.js

Lines changed: 11 additions & 5 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.1 - 2016-02-23T07:32:45.020Z
4+
* Version: 1.8.2 - 2016-03-17T13:37:16.675Z
55
* License: MIT
66
*/
77

@@ -20,7 +20,8 @@ angular.module('ui.mask', [])
2020
},
2121
clearOnBlur: true,
2222
clearOnBlurPlaceholder: false,
23-
eventsToHandle: ['input', 'keyup', 'click', 'focus']
23+
eventsToHandle: ['input', 'keyup', 'click', 'focus'],
24+
addDefaultPlaceholder: true
2425
})
2526
.provider('uiMask.Config', function() {
2627
var options = {};
@@ -34,6 +35,9 @@ angular.module('ui.mask', [])
3435
this.eventsToHandle = function(eventsToHandle) {
3536
return options.eventsToHandle = eventsToHandle;
3637
};
38+
this.addDefaultPlaceholder = function(addDefaultPlaceholder) {
39+
return options.addDefaultPlaceholder = addDefaultPlaceholder;
40+
};
3741
this.$get = ['uiMaskConfig', function(uiMaskConfig) {
3842
var tempOptions = uiMaskConfig;
3943
for(var prop in options)
@@ -219,7 +223,7 @@ angular.module('ui.mask', [])
219223
if (iAttrs.maxlength) { // Double maxlength to allow pasting new val at end of mask
220224
iElement.attr('maxlength', maskCaretMap[maskCaretMap.length - 1] * 2);
221225
}
222-
if ( ! originalPlaceholder) {
226+
if ( ! originalPlaceholder && linkOptions.addDefaultPlaceholder) {
223227
iElement.attr('placeholder', maskPlaceholder);
224228
}
225229
var viewValue = controller.$modelValue;
@@ -420,8 +424,10 @@ angular.module('ui.mask', [])
420424
valueMasked = '';
421425
iElement.val('');
422426
scope.$apply(function() {
423-
//don't call $setViewValue to avoid changing $pristine state.
424-
controller.$viewValue = '';
427+
//only $setViewValue when not $pristine to avoid changing $pristine state.
428+
if (!controller.$pristine) {
429+
controller.$setViewValue('');
430+
}
425431
});
426432
}
427433
}

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.1",
3+
"version": "1.8.2",
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)