Skip to content

Commit

Permalink
Update saved checkmark when saving settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bradp committed Sep 30, 2023
1 parent 2bcff31 commit 168b541
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion mousehunt-utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name 🐭️ MouseHunt Utils
// @author bradp
// @version 1.8.5
// @version 1.8.6
// @description MouseHunt Utils is a library of functions that can be used to make other MouseHunt userscripts easily.
// @license MIT
// @namespace bradp
Expand Down Expand Up @@ -833,6 +833,11 @@ const saveSetting = (key, value, identifier = 'mh-utils-settings') => {
* @param {boolean} value The setting value.
*/
const saveSettingAndToggleClass = (node, key, value) => {
const settingAction = event.target.closest('.PagePreferences__settingAction');
if (settingAction) {
node = settingAction;
}

// Toggle the state of the checkbox.
node.classList.toggle('active');

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mousehunt-utils",
"version": "1.8.5",
"version": "1.8.6",
"description": "",
"main": "mousehunt-utils.js",
"scripts": {
Expand Down

0 comments on commit 168b541

Please sign in to comment.