Add separate drag handle for prompt manager on touch screen

Fixes #2239
This commit is contained in:
Cohee
2025-01-15 00:07:06 +02:00
parent eee45281ea
commit f8c6a62c23
2 changed files with 21 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import { debounce_timeout } from './constants.js';
import { renderTemplateAsync } from './templates.js';
import { Popup } from './popup.js';
import { t } from './i18n.js';
import { isMobile } from './RossAscends-mods.js';
function debouncePromise(func, delay) {
let timeoutId;
@ -1562,6 +1563,7 @@ class PromptManager {
listItemHtml += `
<li class="${prefix}prompt_manager_prompt ${draggableClass} ${enabledClass} ${markerClass} ${importantClass}" data-pm-identifier="${escapeHtml(prompt.identifier)}">
<span class="drag-handle">☰</span>
<span class="${prefix}prompt_manager_prompt_name" data-pm-name="${encodedName}">
${isMarkerPrompt ? '<span class="fa-fw fa-solid fa-thumb-tack" title="Marker"></span>' : ''}
${isSystemPrompt ? '<span class="fa-fw fa-solid fa-square-poll-horizontal" title="Global Prompt"></span>' : ''}
@ -1741,6 +1743,7 @@ class PromptManager {
makeDraggable() {
$(`#${this.configuration.prefix}prompt_manager_list`).sortable({
delay: this.configuration.sortableDelay,
handle: isMobile() ? '.drag-handle' : null,
items: `.${this.configuration.prefix}prompt_manager_prompt_draggable`,
update: (event, ui) => {
const promptOrder = this.getPromptOrderForCharacter(this.activeCharacter);