From ee41de480917625a539b43975b07025aae26bc54 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 15 Jul 2021 18:59:29 -0400 Subject: [PATCH] pad_editbar: Deprecate the `toggleDropDown` callback --- doc/api/editbar.md | 2 +- src/static/js/pad_editbar.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/editbar.md b/doc/api/editbar.md index d297eb255..f448a218a 100644 --- a/doc/api/editbar.md +++ b/doc/api/editbar.md @@ -5,7 +5,7 @@ src/static/js/pad_editbar.js ## disable() -## toggleDropDown(dropdown, callback) +## toggleDropDown(dropdown) Shows the dropdown `div.popup` whose `id` equals `dropdown`. ## registerCommand(cmd, callback) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 46b4ad914..dd352fef9 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -200,7 +200,9 @@ exports.padeditbar = { } if (padeditor.ace) padeditor.ace.focus(); }, - toggleDropDown(moduleName, cb) { + + // cb is deprecated (this function is synchronous so a callback is unnecessary). + toggleDropDown(moduleName, cb = null) { let cbErr = null; try { // do nothing if users are sticked