diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index b64216ff0..f44855f7b 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -360,35 +360,31 @@ exports.padeditbar = { this.registerDropdownCommand('embed'); this.registerCommand('settings', () => { - this.toggleDropDown('settings', () => { - $('#options-stickychat').focus(); - }); + this.toggleDropDown('settings'); + $('#options-stickychat').focus(); }); this.registerCommand('import_export', () => { - this.toggleDropDown('import_export', () => { - // If Import file input exists then focus on it.. - if ($('#importfileinput').length !== 0) { - setTimeout(() => { - $('#importfileinput').focus(); - }, 100); - } else { - $('.exportlink').first().focus(); - } - }); + this.toggleDropDown('import_export'); + // If Import file input exists then focus on it.. + if ($('#importfileinput').length !== 0) { + setTimeout(() => { + $('#importfileinput').focus(); + }, 100); + } else { + $('.exportlink').first().focus(); + } }); this.registerCommand('showusers', () => { - this.toggleDropDown('users', () => { - $('#myusernameedit').focus(); - }); + this.toggleDropDown('users'); + $('#myusernameedit').focus(); }); this.registerCommand('embed', () => { this.setEmbedLinks(); - this.toggleDropDown('embed', () => { - $('#linkinput').focus().select(); - }); + this.toggleDropDown('embed'); + $('#linkinput').focus().select(); }); this.registerCommand('savedRevision', () => { diff --git a/src/static/js/pad_modals.js b/src/static/js/pad_modals.js index 99d4dd6ac..54bd83877 100644 --- a/src/static/js/pad_modals.js +++ b/src/static/js/pad_modals.js @@ -32,15 +32,14 @@ const padmodals = (() => { pad = _pad; }, showModal: (messageId) => { - padeditbar.toggleDropDown('none', () => { - $('#connectivity .visible').removeClass('visible'); - $(`#connectivity .${messageId}`).addClass('visible'); + padeditbar.toggleDropDown('none'); + $('#connectivity .visible').removeClass('visible'); + $(`#connectivity .${messageId}`).addClass('visible'); - const $modal = $(`#connectivity .${messageId}`); - automaticReconnect.showCountDownTimerToReconnectOnModal($modal, pad); + const $modal = $(`#connectivity .${messageId}`); + automaticReconnect.showCountDownTimerToReconnectOnModal($modal, pad); - padeditbar.toggleDropDown('connectivity'); - }); + padeditbar.toggleDropDown('connectivity'); }, showOverlay: () => { // Prevent the user to interact with the toolbar. Useful when user is disconnected for example