renderToolbar: support empty data i.e. dashboard feed

This commit is contained in:
Andrew Dolgov 2021-02-15 07:46:24 +03:00
parent a2e688fcb2
commit 9f31381bb6
2 changed files with 46 additions and 42 deletions

View File

@ -141,7 +141,7 @@ class Feeds extends Handler_Protected {
$reply['toolbar'] = [ $reply['toolbar'] = [
'site_url' => $feed_site_url, 'site_url' => $feed_site_url,
'title' => truncate_string(strip_tags($feed_title), 30), 'title' => strip_tags($feed_title),
'error' => $last_error, 'error' => $last_error,
'last_updated' => $last_updated, 'last_updated' => $last_updated,
'plugin_menu_items' => $plugin_menu_items, 'plugin_menu_items' => $plugin_menu_items,

View File

@ -572,6 +572,7 @@ const Headlines = {
const search_query = Feeds._search_query ? Feeds._search_query.query : ""; const search_query = Feeds._search_query ? Feeds._search_query.query : "";
const target = dijit.byId('toolbar-headlines'); const target = dijit.byId('toolbar-headlines');
if (tb && typeof tb == 'object') {
target.attr('innerHTML', target.attr('innerHTML',
` `
<span class='left'> <span class='left'>
@ -615,6 +616,9 @@ const Headlines = {
${tb.plugin_buttons} ${tb.plugin_buttons}
</span> </span>
`); `);
} else {
target.attr('innerHTML', '');
}
dojo.parser.parse(target.domNode); dojo.parser.parse(target.domNode);
}, },