Skip to content

Commit

Permalink
Hide the detached popup preference when it doesn't do anything
Browse files Browse the repository at this point in the history
On releases of TB before TB128, don't show the detached popup
preference in the preferences window.
  • Loading branch information
jikamens committed Sep 2, 2024
1 parent 507df43 commit 6a216a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 6 additions & 4 deletions ui/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@
<span class="option-label">__MSG_SubfolderPreference__</span>
<input type="text" id="subfolderName" class="preference">
</label>
<label>
<input type="checkbox" id="detachedPopup" class="preferences"/>
<span class="option-label">__MSG_detachedPopupPreference__</span>
</label>
<div id="detachedPopupDiv">
<label>
<input type="checkbox" id="detachedPopup" class="preferences"/>
<span class="option-label">__MSG_detachedPopupPreference__</span>
</label>
</div>
</section>

<section>
Expand Down
9 changes: 7 additions & 2 deletions ui/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ const SLOptions = {
funcSelectors[`ufunc-accel-ctrl-${funcName}`] = "accelCtrlfuncselect";
funcSelectors[`ufunc-accel-shift-${funcName}`] = "accelShiftfuncselect";
for (let i = 1; i < 4; i++)
funcSelectors[`ufunc-shortcut-${i}-${funcName}`] =
`quickOptions${i}funcselect`;
funcSelectors[
`ufunc-shortcut-${i}-${funcName}`
] = `quickOptions${i}funcselect`;

for (let key of Object.keys(funcSelectors)) {
if (document.getElementById(key)) continue;
Expand Down Expand Up @@ -1048,6 +1049,10 @@ const SLOptions = {
document.getElementById("showColumnRow").hidden = true;
});

await SLStatic.tb128(false, () => {
document.getElementById("detachedPopupDiv").hidden = true;
});

await SLOptions.applyPrefsToUI();
await SLOptions.attachListeners();

Expand Down

0 comments on commit 6a216a5

Please sign in to comment.