Skip to content

Commit

Permalink
πŸ›(dw_locktimer) Don't add the default callback twice
Browse files Browse the repository at this point in the history
If a plugin does another init() to attach the dw_locktimer to its own editor,
then the default callback would be added a second time, causing unexpected
and undesired behavior.
  • Loading branch information
micgro42 committed Jun 7, 2018
1 parent 0fff419 commit 87bed8b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/scripts/locktimer.js
Expand Up @@ -43,8 +43,6 @@ var dw_locktimer = {
return;
}

dw_locktimer.callbacks.push(dw_locktimer.refreshed);

// register refresh event
$edit.keypress(dw_locktimer.refresh);
// start timer
Expand Down Expand Up @@ -145,3 +143,4 @@ var dw_locktimer = {
dw_locktimer.reset();
}
};
dw_locktimer.callbacks.push(dw_locktimer.refreshed);

0 comments on commit 87bed8b

Please sign in to comment.