Move sortable delay into configuration

This commit is contained in:
maver
2023-08-19 14:59:48 +02:00
parent b0158bd72d
commit 0084ea2461
2 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import {callPopup, event_types, eventSource, is_send_press, main_api, substitute
import { is_group_generating } from "./group-chats.js";
import {TokenHandler} from "./openai.js";
import {power_user} from "./power-user.js";
import { debounce, getSortableDelay, waitUntilCondition } from "./utils.js";
import { debounce, waitUntilCondition } from "./utils.js";
function debouncePromise(func, delay) {
let timeoutId;
@ -172,7 +172,7 @@ function PromptManagerModule() {
strategy: 'global',
dummyId: 100000
},
draggable: true,
sortableDelay: 30,
warningTokenThreshold: 1500,
dangerTokenThreshold: 500,
defaultPrompts: {
@ -1569,7 +1569,7 @@ PromptManagerModule.prototype.getFormattedDate = function() {
*/
PromptManagerModule.prototype.makeDraggable = function () {
$(`#${this.configuration.prefix}prompt_manager_list`).sortable({
delay: getSortableDelay(),
delay: this.configuration.sortableDelay,
items: `.${this.configuration.prefix}prompt_manager_prompt_draggable`,
update: ( event, ui ) => {
const promptOrder = this.getPromptOrderForCharacter(this.activeCharacter);