Closed Locutus83 closed 5 years ago
@HTMLGuyLLC Any thoughts on this?
Sorry, been tied up with lots of projects. I like the idea of adding a destructor, but I'm concerned about the namespaced mousemove event. How does it get triggered? You didn't add any other code related to mousemove in the plugin, so I assume it's something you have in your project.
It gets triggered the same as any event using the string before the ".
". The namespacing is just for specific referencing when using off()
.
A good explanation can be found here: https://css-tricks.com/namespaced-events-jquery/
Love it. Thanks for the reference. I will merge your pull request shortly.
I changed the method name to destroy() and minimized the JS. Please pull the latest version and test for me if you get a chance. Thank you for your contribution! I gave you credit on the version.
I changed the name of that method 4 or 5 times before creating the pull request. I'm fine with you calling it destroy
... that was the first name that I used.
I'll have to test this tomorrow. I have too much going on this evening. I will let you know.
Works like a charm! Thanks!
I just realized that 3.1.0 didn't get released to https://www.npmjs.com/package/jtimeout. Can we get that updated?
Done, sorry about that.
I'm not sure how you feel about this... Our implementation allows the users to close the timeout notification (
#jTimedoutAlert
) and remain on the page after the server has terminated their session. In order to achieve this, I had to namespace themousemove
event so it could be removed if they closed the alert. this is done in our code by customizing the jAlert with'closeBtn': true
and providing anonClose
function. Without this destructor, moving the mouse re-creates countdowns and it tries to keep tracking and updating a session that has terminated.Do you feel there are other elements that should be destroyed by such a method?
If you don't like the destructor, can I at least get the namespaced
mousemove
event?