Fixed event override

This commit is contained in:
Luis Leiva 2017-11-16 13:25:00 +01:00
parent ab5059514c
commit 1bc04f757e
2 changed files with 4 additions and 4 deletions

View File

@ -179,8 +179,8 @@
// A helper function to override user-defined event listeners. // A helper function to override user-defined event listeners.
function override(ev) { function override(ev) {
// Flag event override so that it doesn't get fired more than once. // Flag event override so that it doesn't get fired more than once.
if (config.options.$$bound) return; if (config.options[ev + '$bound']) return;
config.options.$$bound = true; config.options[ev + '$bound'] = true;
if (config.options.events && typeof config.options.events[ev] === 'function') { if (config.options.events && typeof config.options.events[ev] === 'function') {
// User has defined this event, so wrap it. // User has defined this event, so wrap it.

View File

@ -182,8 +182,8 @@
// A helper function to override user-defined event listeners. // A helper function to override user-defined event listeners.
function override(ev) { function override(ev) {
// Flag event override so that it doesn't get fired more than once. // Flag event override so that it doesn't get fired more than once.
if (config.options.$$bound) return; if (config.options[ev + '$bound']) return;
config.options.$$bound = true; config.options[ev + '$bound'] = true;
if (config.options.events && typeof config.options.events[ev] === 'function') { if (config.options.events && typeof config.options.events[ev] === 'function') {
// User has defined this event, so wrap it. // User has defined this event, so wrap it.