Skip to content

Commit

Permalink
fix and update clean up event listener for refresh btn
Browse files Browse the repository at this point in the history
  • Loading branch information
CopyDemon committed Apr 1, 2024
1 parent 204eeb9 commit 7a5cf0d
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ export class Toolbar {
*/

cleanUpEvent(){
/**
* TODO: since these reset function are identical, fix them later by use a loop to generate.
*/
// zoom btns
let zoomInBtn = document.getElementById('zoom-in-btn');
let zoomOutBtn = document.getElementById('zoom-out-btn');
Expand Down Expand Up @@ -341,5 +344,16 @@ export class Toolbar {
console.log(`error save btn replacement error handle in toolbar, parent not found!`);
}
}

// reset header refresh btn event listener
let refreshBtn = document.getElementById('refresh_btn');
if(refreshBtn){
let refreshBtnClone = refreshBtn.cloneNode(true);
if(refreshBtn.parentNode){
refreshBtn.parentNode.replaceChild(refreshBtnClone, refreshBtn);
}else{
console.log(`error refresh btn replacement error handle in toolbar, parent not found!`);
}
}
}
}

0 comments on commit 7a5cf0d

Please sign in to comment.