mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Switch to module init function pattern
This commit is contained in:
@@ -30,11 +30,6 @@ const toggleBulkEditMode = (isBulkEdit) => {
|
||||
}
|
||||
};
|
||||
|
||||
characterGroupOverlay.addStateChangeCallback((state) => {
|
||||
if (state === BulkEditOverlayState.select) enableBulkEdit();
|
||||
if (state === BulkEditOverlayState.browse) disableBulkEdit();
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggles bulk edit mode on/off when the edit button is clicked.
|
||||
*/
|
||||
@@ -117,8 +112,13 @@ function disableBulkSelect() {
|
||||
/**
|
||||
* Entry point that runs on page load.
|
||||
*/
|
||||
jQuery(() => {
|
||||
export function initBulkEdit() {
|
||||
characterGroupOverlay.addStateChangeCallback((state) => {
|
||||
if (state === BulkEditOverlayState.select) enableBulkEdit();
|
||||
if (state === BulkEditOverlayState.browse) disableBulkEdit();
|
||||
});
|
||||
|
||||
$('#bulkEditButton').on('click', onEditButtonClick);
|
||||
$('#bulkSelectAllButton').on('click', onSelectAllButtonClick);
|
||||
$('#bulkDeleteButton').on('click', onDeleteButtonClick);
|
||||
});
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ function onServerConnectClick() {
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(function () {
|
||||
export function initServerHistory() {
|
||||
$('[data-server-history]').each(createServerAutocomplete);
|
||||
$(document).on('click', '[data-server-connect]', onServerConnectClick);
|
||||
});
|
||||
}
|
||||
|
@@ -49,6 +49,6 @@ function removeHighlighting() {
|
||||
$('.highlighted').removeClass('highlighted'); // Remove CSS class from previously highlighted elements
|
||||
}
|
||||
|
||||
jQuery(() => {
|
||||
export function initSettingsSearch() {
|
||||
$('#settingsSearch').on('input change', searchSettings);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user