Skip to content

Adds auto loading to apply mask to element#107

Closed
jpSimkins wants to merge 3 commits intoplentz:masterfrom
jpSimkins:master
Closed

Adds auto loading to apply mask to element#107
jpSimkins wants to merge 3 commits intoplentz:masterfrom
jpSimkins:master

Conversation

@jpSimkins
Copy link

This allows the mask to be applied on initiation instead of on click. New
setting 'autoLoad', defaults to false, when set true will apply the mask
to the element when initiated

jpSimkins added 3 commits January 13, 2014 20:56
This allows the mask to be applied on page load instead of on click. New
setting 'autoLoad', defaults to false, when set true will apply the mask
to the element.
Added a quick comment for the autoLoad setting. I may rename this in the
future to a name that fits better.
Fixed description for autoLoad
@plentz
Copy link
Owner

plentz commented Jan 16, 2014

@jpSimkins can you add a test for this one? I'm inclined to merge it, but with a test is always better :)

@plentz
Copy link
Owner

plentz commented Jan 16, 2014

@jpSimkins btw, I didn't remembered why I didn't accepted it in the first place, but I found this:

because .maskMoney().maskMoney('mask') should have the exact same behavior.

Could you please say why you thing this one is needed?

@jpSimkins
Copy link
Author

Ahh, To be honest I just updated to the new version and I apparently had this in the v.2.x. For me, I needed to add that back as I have these classes defined in my system and they use autoLoad and everything broke without it. You are correct, the .maskMoney().mask() is the exact same thing. All the autoLoad setting does is call mask() once it's been applied to the selector. For me, autoLoad is preferred but it's really the same thing. Guess there's no point in adding it since it's easy just to append .mask(). Sorry about that.

@plentz
Copy link
Owner

plentz commented Jan 16, 2014

@jpSimkins no problem, really. Contributions are always welcome :)

Thanks anyway 👍

@plentz plentz closed this Jan 16, 2014
@jpSimkins
Copy link
Author

Actually, I noticed that .maskMoney().mask() does not seem to work. I tested it on the demo page, #demo1 and I got the error: Uncaught TypeError: Object [object Object] has no method 'mask' A bug perhaps?

To get it working you can call .maskMoney().trigger('mask').

Just wanted to point this out because I find the autoLoad option very useful.

@plentz
Copy link
Owner

plentz commented Jan 17, 2014

@jpSimkins I was just stupid. It should be .maskMoney().maskMoney('mask');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments