refactor: replace the deprecated js api

This commit is contained in:
Cotes Chung
2023-02-15 04:53:40 +08:00
parent a2d01365de
commit c3a840076e
16 changed files with 47 additions and 58 deletions

View File

@@ -2,12 +2,12 @@
* Listener for theme mode toggle
*/
$(function () {
$(".mode-toggle").click((e) => {
$(".mode-toggle").on('click',(e) => {
const $target = $(e.target);
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
$target : $target.parent());
$btn.blur(); // remove the clicking outline
$btn.trigger('blur'); // remove the clicking outline
flipMode();
});
});