web/_javascript/commons/mode-toggle.js

14 lines
345 B
JavaScript
Raw Normal View History

2022-10-25 14:26:44 +03:00
/**
* Listener for theme mode toggle
*/
2022-10-25 14:26:44 +03:00
$(function () {
$(".mode-toggle").on('click',(e) => {
2022-10-25 14:26:44 +03:00
const $target = $(e.target);
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
$target : $target.parent());
$btn.trigger('blur'); // remove the clicking outline
2022-10-25 14:26:44 +03:00
flipMode();
});
});