MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / shiftOrConfirm

Function shiftOrConfirm

ui/media/js/main.js:339–351  ·  view source on GitHub ↗
(e, prompt, fn, allowSkip = true)

Source from the content-addressed store, hash-verified

337// Otherwise, a confirmation dialog is shown. If the user confirms, the function fn will also
338// be executed.
339function shiftOrConfirm(e, prompt, fn, allowSkip = true) {
340 e.stopPropagation()
341 let tip = allowSkip
342 ? '<small>Tip: To skip this dialog, use shift-click or disable the "Confirm dangerous actions" setting in the Settings tab.</small>'
343 : ""
344 if (allowSkip && (e.shiftKey || !confirmDangerousActionsField.checked)) {
345 fn(e)
346 } else {
347 confirm(tip, prompt, () => {
348 fn(e)
349 })
350 }
351}
352
353function undoableRemove(element, doubleUndo = false) {
354 let data = {

Callers 2

createTaskFunction · 0.85
main.jsFile · 0.85

Calls 2

confirmFunction · 0.85
fnFunction · 0.70

Tested by

no test coverage detected