diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 9031a418d9..41da3187bb 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -135,9 +135,9 @@ class FileManager extends FileSystemApi { if (this.currentRequest) { let reject = false let savedAsAnotherFile = false - let warnToaster - const actions = yo`
- + let actions = (toaster) => { + return yo`
+
` - warnToaster = await toaster(yo`
${this.currentRequest.from} is modyfing ${path}
`, actions, { time: 4000 }) + } + await toaster(yo`
${this.currentRequest.from} is modyfing ${path}
`, actions, { time: 4000 }) if (reject) throw new Error(`set file operation on ${path} aborted by user.`) if (savedAsAnotherFile) return } diff --git a/src/app/ui/tooltip.js b/src/app/ui/tooltip.js index 4632193c8f..8c44f905e8 100644 --- a/src/app/ui/tooltip.js +++ b/src/app/ui/tooltip.js @@ -5,11 +5,11 @@ var modal = require('./modal-dialog-custom') /** * Open a tooltip * @param {string} tooltipText The text shown by the tooltip - * @param {HTMLElement} [action] An HTMLElement to display for action + * @param {function} [action] Returns An HTMLElement to display for action */ module.exports = function addTooltip (tooltipText, action, opts) { let t = new Toaster() - return t.render(tooltipText, action, opts) + return t.render(tooltipText, action(t), opts) } class Toaster {