kennethcachia / background-check

Automatically switch to a darker or a lighter version of an element depending on the brightness of images behind it.
http://kennethcachia.com/background-check/
MIT License
3.27k stars 282 forks source link

Remove window event listeners when plugin is destroyed #45

Closed danielkorte closed 9 years ago

danielkorte commented 9 years ago

Currently, once the plugin is destroyed it keeps throwing errors in the get function since 'windowEvents' is no longer in the attrs variable. Removing the window listeners when the destroy function is called fixes that. Great plugin! Cheers!

danielkorte commented 9 years ago

My bad. This commit used event namespaces (not available w/ regular vanilla javascript).