mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-05 13:36:47 +01:00
add QR delete confirm
This commit is contained in:
parent
1d3b2a31c6
commit
896d43ade7
@ -1,4 +1,4 @@
|
||||
import { POPUP_TYPE, Popup } from '../../../popup.js';
|
||||
import { POPUP_RESULT, POPUP_TYPE, Popup } from '../../../popup.js';
|
||||
import { setSlashCommandAutoComplete } from '../../../slash-commands.js';
|
||||
import { SlashCommandAbortController } from '../../../slash-commands/SlashCommandAbortController.js';
|
||||
import { SlashCommandBreakPoint } from '../../../slash-commands/SlashCommandBreakPoint.js';
|
||||
@ -358,8 +358,19 @@ export class QuickReply {
|
||||
del.classList.add('fa-solid');
|
||||
del.classList.add('fa-trash-can');
|
||||
del.classList.add('redWarningBG');
|
||||
del.title = 'Remove quick reply';
|
||||
del.addEventListener('click', ()=>this.delete());
|
||||
del.title = 'Remove Quick Reply\n---\nShit+Click to skip confirmation';
|
||||
del.addEventListener('click', async(evt)=>{
|
||||
if (!evt.shiftKey) {
|
||||
const result = await Popup.show.confirm(
|
||||
'Remove Quick Reply',
|
||||
'Are you sure you want to remove this Quick Reply?',
|
||||
);
|
||||
if (result != POPUP_RESULT.AFFIRMATIVE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.delete();
|
||||
});
|
||||
actions.append(del);
|
||||
}
|
||||
itemContent.append(actions);
|
||||
|
Loading…
Reference in New Issue
Block a user