rework net-alert to use iconfont, move it to toolbar start

This commit is contained in:
Andrew Dolgov 2018-12-06 12:30:11 +03:00
parent f89ecda9b8
commit 0ea0b606be
7 changed files with 24 additions and 19 deletions

View File

@ -758,6 +758,9 @@ body.ttrss_main #toolbar-frame #toolbar .dijitDropDownButton .dijitButtonNode,
body.ttrss_main #toolbar-frame #toolbar .dijitComboButton .dijitButtonNode { body.ttrss_main #toolbar-frame #toolbar .dijitComboButton .dijitButtonNode {
border: 0px; border: 0px;
} }
body.ttrss_main #toolbar-frame #toolbar .net-alert i {
color: red;
}
body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines { body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines {
padding-right: 4px; padding-right: 4px;
flex-grow: 2; flex-grow: 2;

File diff suppressed because one or more lines are too long

View File

@ -891,6 +891,10 @@ body.ttrss_main {
border : 0px; border : 0px;
} }
.net-alert i {
color : red;
}
#toolbar-headlines { #toolbar-headlines {
padding-right : 4px; padding-right : 4px;
flex-grow : 2; flex-grow : 2;

View File

@ -161,6 +161,11 @@
<div id="toolbar-frame" dojoType="dijit.layout.ContentPane" region="top"> <div id="toolbar-frame" dojoType="dijit.layout.ContentPane" region="top">
<div id="toolbar" dojoType="dijit.Toolbar"> <div id="toolbar" dojoType="dijit.Toolbar">
<div class="net-alert" style="display : none"
title="<?php echo __("Communication problem with server.") ?>">
<i class="material-icons">error_outline</i>
</div>
<?php <?php
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) {
echo $p->hook_main_toolbar_button(); echo $p->hook_main_toolbar_button();
@ -219,11 +224,6 @@
} }
?> ?>
<button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
title="<?php echo __("Communication problem with server.") ?>">
<img src="images/error.png" />
</button>
<div dojoType="dijit.form.DropDownButton"> <div dojoType="dijit.form.DropDownButton">
<span><?php echo __('Actions...') ?></span> <span><?php echo __('Actions...') ?></span>
<div dojoType="dijit.Menu" style="display: none"> <div dojoType="dijit.Menu" style="display: none">

View File

@ -184,10 +184,7 @@ define(["dojo/_base/declare"], function (declare) {
}, },
handleRpcJson: function(transport) { handleRpcJson: function(transport) {
const netalert_dijit = dijit.byId("net-alert"); const netalert = $$("#toolbar .net-alert")[0];
let netalert = false;
if (netalert_dijit) netalert = netalert_dijit.domNode;
try { try {
const reply = JSON.parse(transport.responseText); const reply = JSON.parse(transport.responseText);
@ -239,16 +236,14 @@ define(["dojo/_base/declare"], function (declare) {
return reply; return reply;
} else { } else {
if (netalert) if (netalert) netalert.show();
netalert.show();
else
Notify.error("Communication problem with server."); Notify.error("Communication problem with server.");
} }
} catch (e) { } catch (e) {
if (netalert) if (netalert) netalert.show();
netalert.show();
else
Notify.error("Communication problem with server."); Notify.error("Communication problem with server.");
console.error(e); console.error(e);

View File

@ -758,6 +758,9 @@ body.ttrss_main #toolbar-frame #toolbar .dijitDropDownButton .dijitButtonNode,
body.ttrss_main #toolbar-frame #toolbar .dijitComboButton .dijitButtonNode { body.ttrss_main #toolbar-frame #toolbar .dijitComboButton .dijitButtonNode {
border: 0px; border: 0px;
} }
body.ttrss_main #toolbar-frame #toolbar .net-alert i {
color: red;
}
body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines { body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines {
padding-right: 4px; padding-right: 4px;
flex-grow: 2; flex-grow: 2;

File diff suppressed because one or more lines are too long