From 8209ee6279c38ba24b1345a62c5d4112a69e834d Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Sat, 3 Aug 2024 01:28:28 -0400 Subject: [PATCH] File Renaming: Rearrange prefs (#4487) --- .../zotero/preferences/preferences_general.js | 6 +- .../preferences/preferences_general.xhtml | 69 ++++++++++--------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_general.js b/chrome/content/zotero/preferences/preferences_general.js index b6cd907367..e54ccf6927 100644 --- a/chrome/content/zotero/preferences/preferences_general.js +++ b/chrome/content/zotero/preferences/preferences_general.js @@ -236,15 +236,15 @@ Zotero_Preferences.General = { }, updateAutoRenameFilesUI: function () { - setTimeout(() => { - document.getElementById('rename-linked-files').disabled = !Zotero.Prefs.get('autoRenameFiles'); - }); + let disabled = !Zotero.Prefs.get('autoRenameFiles'); let typesBox = document.getElementById('zotero-prefpane-file-renaming-file-types-box'); let enabledTypes = Zotero.Prefs.get('autoRenameFiles.fileTypes').split(','); for (let checkbox of typesBox.querySelectorAll('checkbox')) { checkbox.checked = enabledTypes.includes(checkbox.dataset.contentType); + checkbox.disabled = disabled; } + document.getElementById('rename-linked-files').disabled = disabled; }, // diff --git a/chrome/content/zotero/preferences/preferences_general.xhtml b/chrome/content/zotero/preferences/preferences_general.xhtml index 6ebb903b29..7362ac79e4 100644 --- a/chrome/content/zotero/preferences/preferences_general.xhtml +++ b/chrome/content/zotero/preferences/preferences_general.xhtml @@ -109,47 +109,48 @@ + + -