pad_editbar: Always call the callback

pull/5152/head
Richard Hansen 2021-07-15 18:57:59 -04:00
parent 07e05a92eb
commit 148e10821b
1 changed files with 39 additions and 33 deletions

View File

@ -201,6 +201,8 @@ exports.padeditbar = {
if (padeditor.ace) padeditor.ace.focus(); if (padeditor.ace) padeditor.ace.focus();
}, },
toggleDropDown(moduleName, cb) { toggleDropDown(moduleName, cb) {
let cbErr = null;
try {
// do nothing if users are sticked // do nothing if users are sticked
if (moduleName === 'users' && $('#users').hasClass('stickyUsers')) { if (moduleName === 'users' && $('#users').hasClass('stickyUsers')) {
return; return;
@ -240,7 +242,11 @@ exports.padeditbar = {
} }
} }
} }
if (cb) cb(); } catch (err) {
cbErr = err || new Error(err);
} finally {
if (cb) cb(cbErr);
}
}, },
setSyncStatus: (status) => { setSyncStatus: (status) => {
if (status === 'syncing') { if (status === 'syncing') {