Open SeanDKendle opened 8 years ago
I've made these changes, they may not make any sense, or maybe there is a much better way to approach it:
function Inputmask(alias, options) {
var returnVal = this instanceof Inputmask ? ($.isPlainObject(alias) ? options = alias : (options = options || {},
options.alias = alias), this.el = void 0, this.opts = $.extend(!0, {}, this.defaults, options),
this.noMasksCache = options && void 0 !== options.definitions, this.userOptions = options || {},
this.events = {}, void resolveAlias(this.opts.alias, options, this.opts)) : new Inputmask(alias, options);
this.opts.onAfterMask(this);
return returnVal;
}
and in the defaults list:
onAfterMask: $.noop,
onBeforeMask: null,
@SeanKendle ,
Can't you use the onBeforeMask?
Before mask happens before the masking is applied, I needed the masked value after being masked on page load. It was already filled in the server side code by ASP.net, then masks on pageload, then I needed that value after. If I recall correctly, the onBeforeMask returns the value before being masked.
Is there no callback on init? There's a callback onComplete which seems to only be run once a value is input, but my page initializes with values in the textboxes, and while they do mask properly, there is no callback that I can then use to call another function on init - that I can find.
I have altered the code in my file to provide myself a callback "onMaskComplete". I could create a pull request for that or if you want to attack it another way, that's fine. Or just let me know that I'm blind and there is a callback of some sort once the plugin has initialized!
Thanks!