diff --git a/web/pgadmin/static/js/sqleditor/macro.js b/web/pgadmin/static/js/sqleditor/macro.js index c8f9292f3..da4f3b4c7 100644 --- a/web/pgadmin/static/js/sqleditor/macro.js +++ b/web/pgadmin/static/js/sqleditor/macro.js @@ -272,11 +272,12 @@ let MacroDialog = { ${gettext('Manage Macros...')} - - `; + `; + + let macro_list_tmpl = ''; _.each(macros, function(m) { if (m.name) { - str += `
  • + macro_list_tmpl += `
  • ${_.escape(m.name)} (${m.key_label}) @@ -285,6 +286,7 @@ let MacroDialog = { } }); + if (macro_list_tmpl.length > 0) str += '
  • ' + macro_list_tmpl; $($.find('div.btn-group.mr-1.user_macros ul.dropdown-menu')).html($(str)); self.close(); // Close the dialog now