pad_editbar: Don't pass a callback to toggleDropDown()

The function is synchronous so there's no point.
This commit is contained in:
Richard Hansen 2021-08-14 07:08:20 -04:00
parent 59d6a8b321
commit a1b924f746
2 changed files with 21 additions and 26 deletions

View file

@ -360,13 +360,12 @@ exports.padeditbar = {
this.registerDropdownCommand('embed'); this.registerDropdownCommand('embed');
this.registerCommand('settings', () => { this.registerCommand('settings', () => {
this.toggleDropDown('settings', () => { this.toggleDropDown('settings');
$('#options-stickychat').focus(); $('#options-stickychat').focus();
}); });
});
this.registerCommand('import_export', () => { this.registerCommand('import_export', () => {
this.toggleDropDown('import_export', () => { this.toggleDropDown('import_export');
// If Import file input exists then focus on it.. // If Import file input exists then focus on it..
if ($('#importfileinput').length !== 0) { if ($('#importfileinput').length !== 0) {
setTimeout(() => { setTimeout(() => {
@ -376,20 +375,17 @@ exports.padeditbar = {
$('.exportlink').first().focus(); $('.exportlink').first().focus();
} }
}); });
});
this.registerCommand('showusers', () => { this.registerCommand('showusers', () => {
this.toggleDropDown('users', () => { this.toggleDropDown('users');
$('#myusernameedit').focus(); $('#myusernameedit').focus();
}); });
});
this.registerCommand('embed', () => { this.registerCommand('embed', () => {
this.setEmbedLinks(); this.setEmbedLinks();
this.toggleDropDown('embed', () => { this.toggleDropDown('embed');
$('#linkinput').focus().select(); $('#linkinput').focus().select();
}); });
});
this.registerCommand('savedRevision', () => { this.registerCommand('savedRevision', () => {
padsavedrevs.saveNow(); padsavedrevs.saveNow();

View file

@ -32,7 +32,7 @@ const padmodals = (() => {
pad = _pad; pad = _pad;
}, },
showModal: (messageId) => { showModal: (messageId) => {
padeditbar.toggleDropDown('none', () => { padeditbar.toggleDropDown('none');
$('#connectivity .visible').removeClass('visible'); $('#connectivity .visible').removeClass('visible');
$(`#connectivity .${messageId}`).addClass('visible'); $(`#connectivity .${messageId}`).addClass('visible');
@ -40,7 +40,6 @@ const padmodals = (() => {
automaticReconnect.showCountDownTimerToReconnectOnModal($modal, pad); automaticReconnect.showCountDownTimerToReconnectOnModal($modal, pad);
padeditbar.toggleDropDown('connectivity'); padeditbar.toggleDropDown('connectivity');
});
}, },
showOverlay: () => { showOverlay: () => {
// Prevent the user to interact with the toolbar. Useful when user is disconnected for example // Prevent the user to interact with the toolbar. Useful when user is disconnected for example