mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Change class name for coherence
This commit is contained in:
parent
a0f828a2da
commit
dbc7f460e4
@ -246,7 +246,7 @@ class BulkTagPopupHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CharacterGroupOverlayState {
|
class BulkEditOverlayState {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@ -278,7 +278,7 @@ class BulkEditOverlay {
|
|||||||
|
|
||||||
static longPressDelay = 2800;
|
static longPressDelay = 2800;
|
||||||
|
|
||||||
#state = CharacterGroupOverlayState.browse;
|
#state = BulkEditOverlayState.browse;
|
||||||
#longPress = false;
|
#longPress = false;
|
||||||
#stateChangeCallbacks = [];
|
#stateChangeCallbacks = [];
|
||||||
#selectedCharacters = [];
|
#selectedCharacters = [];
|
||||||
@ -336,12 +336,12 @@ class BulkEditOverlay {
|
|||||||
/**
|
/**
|
||||||
* Set the overlay to browse mode
|
* Set the overlay to browse mode
|
||||||
*/
|
*/
|
||||||
browseState = () => this.state = CharacterGroupOverlayState.browse;
|
browseState = () => this.state = BulkEditOverlayState.browse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the overlay to select mode
|
* Set the overlay to select mode
|
||||||
*/
|
*/
|
||||||
selectState = () => this.state = CharacterGroupOverlayState.select;
|
selectState = () => this.state = BulkEditOverlayState.select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up a Sortable grid for the loaded page
|
* Set up a Sortable grid for the loaded page
|
||||||
@ -368,7 +368,7 @@ class BulkEditOverlay {
|
|||||||
*/
|
*/
|
||||||
handleStateChange = () => {
|
handleStateChange = () => {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case CharacterGroupOverlayState.browse:
|
case BulkEditOverlayState.browse:
|
||||||
this.container.classList.remove(BulkEditOverlay.selectModeClass);
|
this.container.classList.remove(BulkEditOverlay.selectModeClass);
|
||||||
this.#enableClickEventsForCharacters();
|
this.#enableClickEventsForCharacters();
|
||||||
this.clearSelectedCharacters();
|
this.clearSelectedCharacters();
|
||||||
@ -376,7 +376,7 @@ class BulkEditOverlay {
|
|||||||
this.#disableBulkEditButtonHighlight();
|
this.#disableBulkEditButtonHighlight();
|
||||||
CharacterContextMenu.hide();
|
CharacterContextMenu.hide();
|
||||||
break;
|
break;
|
||||||
case CharacterGroupOverlayState.select:
|
case BulkEditOverlayState.select:
|
||||||
this.container.classList.add(BulkEditOverlay.selectModeClass);
|
this.container.classList.add(BulkEditOverlay.selectModeClass);
|
||||||
this.#disableClickEventsForCharacters();
|
this.#disableClickEventsForCharacters();
|
||||||
this.enableContextMenu();
|
this.enableContextMenu();
|
||||||
@ -415,9 +415,9 @@ class BulkEditOverlay {
|
|||||||
this.isLongPress = true;
|
this.isLongPress = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.isLongPress) {
|
if (this.isLongPress) {
|
||||||
if (this.state === CharacterGroupOverlayState.browse)
|
if (this.state === BulkEditOverlayState.browse)
|
||||||
this.selectState();
|
this.selectState();
|
||||||
else if (this.state === CharacterGroupOverlayState.select)
|
else if (this.state === BulkEditOverlayState.select)
|
||||||
CharacterContextMenu.show(...this.#getContextMenuPosition(event));
|
CharacterContextMenu.show(...this.#getContextMenuPosition(event));
|
||||||
}
|
}
|
||||||
}, BulkEditOverlay.longPressDelay);
|
}, BulkEditOverlay.longPressDelay);
|
||||||
@ -428,7 +428,7 @@ class BulkEditOverlay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleCancelClick = () => {
|
handleCancelClick = () => {
|
||||||
this.state = CharacterGroupOverlayState.browse;
|
this.state = BulkEditOverlayState.browse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -563,4 +563,4 @@ class BulkEditOverlay {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {CharacterGroupOverlayState, CharacterContextMenu, BulkEditOverlay};
|
export {BulkEditOverlayState, CharacterContextMenu, BulkEditOverlay};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { characters, getCharacters, handleDeleteCharacter, callPopup } from "../script.js";
|
import { characters, getCharacters, handleDeleteCharacter, callPopup } from "../script.js";
|
||||||
import {BulkEditOverlay, CharacterGroupOverlayState} from "./BulkEditOverlay.js";
|
import {BulkEditOverlay, BulkEditOverlayState} from "./BulkEditOverlay.js";
|
||||||
|
|
||||||
|
|
||||||
let is_bulk_edit = false;
|
let is_bulk_edit = false;
|
||||||
@ -29,8 +29,8 @@ const toggleBulkEditMode = (isBulkEdit) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(new BulkEditOverlay()).addStateChangeCallback((state) => {
|
(new BulkEditOverlay()).addStateChangeCallback((state) => {
|
||||||
if (state === CharacterGroupOverlayState.select) enableBulkEdit();
|
if (state === BulkEditOverlayState.select) enableBulkEdit();
|
||||||
if (state === CharacterGroupOverlayState.browse) disableBulkEdit();
|
if (state === BulkEditOverlayState.browse) disableBulkEdit();
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user