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 {
border: 0px;
}
body.ttrss_main #toolbar-frame #toolbar .net-alert i {
color: red;
}
body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines {
padding-right: 4px;
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;
}
.net-alert i {
color : red;
}
#toolbar-headlines {
padding-right : 4px;
flex-grow : 2;

View File

@ -161,6 +161,11 @@
<div id="toolbar-frame" dojoType="dijit.layout.ContentPane" region="top">
<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
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) {
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">
<span><?php echo __('Actions...') ?></span>
<div dojoType="dijit.Menu" style="display: none">

View File

@ -184,10 +184,7 @@ define(["dojo/_base/declare"], function (declare) {
},
handleRpcJson: function(transport) {
const netalert_dijit = dijit.byId("net-alert");
let netalert = false;
if (netalert_dijit) netalert = netalert_dijit.domNode;
const netalert = $$("#toolbar .net-alert")[0];
try {
const reply = JSON.parse(transport.responseText);
@ -239,17 +236,15 @@ define(["dojo/_base/declare"], function (declare) {
return reply;
} else {
if (netalert)
netalert.show();
else
Notify.error("Communication problem with server.");
if (netalert) netalert.show();
Notify.error("Communication problem with server.");
}
} catch (e) {
if (netalert)
netalert.show();
else
Notify.error("Communication problem with server.");
if (netalert) netalert.show();
Notify.error("Communication problem with server.");
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 {
border: 0px;
}
body.ttrss_main #toolbar-frame #toolbar .net-alert i {
color: red;
}
body.ttrss_main #toolbar-frame #toolbar #toolbar-headlines {
padding-right: 4px;
flex-grow: 2;

File diff suppressed because one or more lines are too long