From 3da8d2c233da7bf6eb7c9b2b54dbbbd3ecaa59ae Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 27 Sep 2014 10:31:12 +0200 Subject: [PATCH] Fixed error messages covered with content spinner --- public_html/js/Presenters/HomePresenter.js | 1 + public_html/js/Presenters/PostListPresenter.js | 1 + public_html/js/Presenters/PostPresenter.js | 10 ++++++++-- public_html/js/Presenters/UserListPresenter.js | 1 + public_html/js/Presenters/UserPresenter.js | 1 + 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/public_html/js/Presenters/HomePresenter.js b/public_html/js/Presenters/HomePresenter.js index 4b773b63..4f732452 100644 --- a/public_html/js/Presenters/HomePresenter.js +++ b/public_html/js/Presenters/HomePresenter.js @@ -40,6 +40,7 @@ App.Presenters.HomePresenter = function( }).fail(function(response) { messagePresenter.showError($el, response.json && response.json.error || response); + loaded(); }); } diff --git a/public_html/js/Presenters/PostListPresenter.js b/public_html/js/Presenters/PostListPresenter.js index 7c295ce9..800d7adf 100644 --- a/public_html/js/Presenters/PostListPresenter.js +++ b/public_html/js/Presenters/PostListPresenter.js @@ -41,6 +41,7 @@ App.Presenters.PostListPresenter = function( failCallback: function(response) { $el.empty(); messagePresenter.showError($el, response.json && response.json.error || response); + loaded(); } }, function() { diff --git a/public_html/js/Presenters/PostPresenter.js b/public_html/js/Presenters/PostPresenter.js index 321c75ad..99971d8d 100644 --- a/public_html/js/Presenters/PostPresenter.js +++ b/public_html/js/Presenters/PostPresenter.js @@ -63,7 +63,10 @@ App.Presenters.PostPresenter = function( historyTemplate = _.template(historyTemplateHtml); reinit(args, loaded); - }).fail(showGenericError); + }).fail(function(response) { + showGenericError(response); + loaded(); + }); } function reinit(args, loaded) { @@ -80,7 +83,10 @@ App.Presenters.PostPresenter = function( topNavigationPresenter.changeTitle('@' + post.id); render(); loaded(); - }).fail(showGenericError); + }).fail(function(response) { + showGenericError(response); + loaded(); + }); } function render() { diff --git a/public_html/js/Presenters/UserListPresenter.js b/public_html/js/Presenters/UserListPresenter.js index 78a049ef..78ca59da 100644 --- a/public_html/js/Presenters/UserListPresenter.js +++ b/public_html/js/Presenters/UserListPresenter.js @@ -40,6 +40,7 @@ App.Presenters.UserListPresenter = function( failCallback: function(response) { $el.empty(); messagePresenter.showError($el, response.json && response.json.error || response); + loaded(); } }, function() { diff --git a/public_html/js/Presenters/UserPresenter.js b/public_html/js/Presenters/UserPresenter.js index a46511f4..7aac2c8e 100644 --- a/public_html/js/Presenters/UserPresenter.js +++ b/public_html/js/Presenters/UserPresenter.js @@ -50,6 +50,7 @@ App.Presenters.UserPresenter = function( }).fail(function(response) { $el.empty(); messagePresenter.showError($messages, response.json && response.json.error || response); + loaded(); }); }