Fix turbolinks issue by cleaning up droplab on page:change
This commit is contained in:
parent
367a15882a
commit
3cf0ee6c1f
|
@ -81,6 +81,25 @@
|
|||
this.bindEvents();
|
||||
loadSearchParamsFromURL();
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue