Bidirectional synchronization of the paging settings in the settings interface.
This commit is contained in:
1 parent
2dc4dec90d
commit
acce9dce38
3 files changed
+14
-3
No files matched your search
@@ -23,6 +23,14 @@ export function setupConfigSync(): void {
|
||||
if (typeof payload.data?.general?.floating_toolbar === 'boolean') {
|
||||
applyToggleState('ftbToggleBtn', payload.data.general.floating_toolbar);
|
||||
}
|
||||
if (typeof payload.data?.general?.paging_minus_equal === 'boolean') {
|
||||
const checkbox = document.getElementById('pagingMinusEqualCheckbox') as HTMLInputElement | null;
|
||||
if (checkbox) checkbox.checked = payload.data.general.paging_minus_equal;
|
||||
}
|
||||
if (typeof payload.data?.general?.paging_tab === 'boolean') {
|
||||
const checkbox = document.getElementById('pagingTabCheckbox') as HTMLInputElement | null;
|
||||
if (checkbox) checkbox.checked = payload.data.general.paging_tab;
|
||||
}
|
||||
if (typeof payload.data?.helpcode?.show_sp_helpcode_in_candidate_window === 'boolean') {
|
||||
applyToggleState(
|
||||
'showShuangpinHelpcodeToggleBtn',
|
||||
|
||||
@@ -19,7 +19,10 @@ function setupPageOptions(): void {
|
||||
checkboxes.forEach((checkbox: Element) => {
|
||||
checkbox.addEventListener('change', (e: Event) => {
|
||||
const target = e.target as HTMLInputElement;
|
||||
if (target.checked) {
|
||||
if (target.value === 'minus') {
|
||||
updateConfig('general.paging_minus_equal', target.checked);
|
||||
} else if (target.value === 'tab') {
|
||||
updateConfig('general.paging_tab', target.checked);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
<div class="content-page-option">
|
||||
<label class="check-option">
|
||||
<input type="checkbox" name="page-method" value="minus">
|
||||
<input type="checkbox" name="page-method" id="pagingMinusEqualCheckbox" value="minus">
|
||||
<span>- / =</span>
|
||||
</label>
|
||||
|
||||
<div class="input-option-divider"></div>
|
||||
|
||||
<label class="check-option">
|
||||
<input type="checkbox" name="page-method" value="tab">
|
||||
<input type="checkbox" name="page-method" id="pagingTabCheckbox" value="tab">
|
||||
<span>Shift+Tab / Tab</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user