Skip to content

Commit

Permalink
Show sticky error message on viewport message listing error
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Sep 18, 2014
1 parent 5b8621c commit bb18b22
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions imp/js/dimpbase.js
Expand Up @@ -2308,6 +2308,20 @@ var DimpBase = {
}
},

/* Handle viewport errors. */
showViewportError: function(show)
{
if ($('viewport_error').visible()) {
if (!show) {
$('viewport_error').hide();
this.viewport.onResize(true);
}
} else if (show) {
$('viewport_error').show();
this.viewport.onResize(true);
}
},

/* Enable/Disable action buttons as needed. */
toggleButtons: function()
{
Expand Down Expand Up @@ -3783,6 +3797,7 @@ var DimpBase = {
}

if (this.viewport && t['imp:viewport']) {
this.showViewportError(t['imp:viewport'].error);
t['imp:viewport'].requestid = e.response.request.rid;
this.viewport.parseJSONResponse(t['imp:viewport']);
}
Expand Down
1 change: 1 addition & 0 deletions imp/lib/Ajax/Application/Viewport/Error.php
Expand Up @@ -48,6 +48,7 @@ public function toObject()
{
$ob = new stdClass;
$ob->cacheid = strval(new Horde_Support_Randomid());
$ob->error = true;
$ob->label = $this->_mbox->label;
$ob->view = $this->_mbox->form_to;

Expand Down
4 changes: 4 additions & 0 deletions imp/templates/dynamic/mailbox.html.php
Expand Up @@ -63,6 +63,10 @@
<span id="search_time_elapsed" style="display:none"></span>
<div id="search_label"></div>
</div>

<div id="viewport_error" style="display:none">
<div><?php echo _("Error loading message list.") ?></div>
</div>
</div>

<div id="msgSplitPane"></div>
Expand Down
9 changes: 9 additions & 0 deletions imp/themes/default/dynamic/screen.css
Expand Up @@ -818,6 +818,15 @@ span.attachmentImg {
padding-right: 12px;
}

/* Viewport error */
#viewport_error {
background-color: red;
padding: 8px 10px;
}
#viewport_error div {
font-weight: bold;
}

/* Redbox styles. */
#RB_window {
max-width: 50%;
Expand Down

0 comments on commit bb18b22

Please sign in to comment.