Commit 3cf0ee6c authored by Clement Ho's avatar Clement Ho

Fix turbolinks issue by cleaning up droplab on page:change

parent 367a1588
...@@ -81,6 +81,25 @@ ...@@ -81,6 +81,25 @@
this.bindEvents(); this.bindEvents();
loadSearchParamsFromURL(); loadSearchParamsFromURL();
this.setDropdown(); this.setDropdown();
document.addEventListener('page:change', this.cleanup);
}
cleanup() {
console.log('cleanup')
if (this.droplab) {
this.droplab.destroy();
this.droplab = null;
}
dropdownHint = null;
dropdownAuthor = null;
dropdownAssignee = null;
dropdownMilestone = null;
dropdownLabel = null;
document.removeEventListener('page:change', this.cleanup);
} }
static addWordToInput(word, addSpace) { static addWordToInput(word, addSpace) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment