Settings to jQuery plugins usually passed as an options object. Also it can have default options, which we can override by passing our own
jQery plugin options
For example for modal on timeout - It's will be better to implement this logic by passing additional options to the plugin, which can set it behaviour, instead of setting timeout directly on the page and call modal after 10 seconds. Something like this
It's also can get other options which will configure the plugin
In this case you can use chaining to prevent calling the same DOM node again
this.eventsHandler(); better to call this something like setEventHandlers. To describe what the func do
ALso chainings
Adding overflow hidden to body during modal initialization leads to hiding vertical scroll bar and as a result small content blinking. Better to avoid such things
Instead of searching for buttons in whole DOM you can look for them just in your wrapperModal via jQuery.find or use delegation
Hi, Roman! thank you for issue. I fixed bugs (hope without creating new ones:) ) deleted old pull request and created new one. Am I allowed to finish this pull request ? Thanks )
Hi Vlad.
Not bad with this task, but some comments
For example for modal on timeout - It's will be better to implement this logic by passing additional options to the plugin, which can set it behaviour, instead of setting timeout directly on the page and call modal after 10 seconds. Something like this
It's also can get other options which will configure the plugin
In this case you can use chaining to prevent calling the same DOM node again
this.eventsHandler();
better to call this something likesetEventHandlers
. To describe what the func doALso chainings
Adding overflow hidden to body during modal initialization leads to hiding vertical scroll bar and as a result small content blinking. Better to avoid such things
Instead of searching for buttons in whole DOM you can look for them just in your
wrapperModal
viajQuery.find
or use delegation