diff --git a/public_html/js/Controls/TagInput.js b/public_html/js/Controls/TagInput.js index bd0e4f05..4e939bbd 100644 --- a/public_html/js/Controls/TagInput.js +++ b/public_html/js/Controls/TagInput.js @@ -296,6 +296,7 @@ App.Controls.TagInput = function($underlyingInput) { attachTagsToSuggestionList($siblings.find('ul'), suggestions); $siblings.slideDown('fast'); } + }).fail(function() { }); } diff --git a/public_html/js/Presenters/PostListPresenter.js b/public_html/js/Presenters/PostListPresenter.js index fa0fbc5f..f6a55929 100644 --- a/public_html/js/Presenters/PostListPresenter.js +++ b/public_html/js/Presenters/PostListPresenter.js @@ -51,6 +51,9 @@ App.Presenters.PostListPresenter = function( function() { reinit(params, function() {}); }); + }).fail(function() { + console.log(arguments); + loaded(); }); jQuery(window).on('resize', windowResized); diff --git a/public_html/js/Presenters/PostPresenter.js b/public_html/js/Presenters/PostPresenter.js index 74c9e7e2..0cc95758 100644 --- a/public_html/js/Presenters/PostPresenter.js +++ b/public_html/js/Presenters/PostPresenter.js @@ -109,6 +109,7 @@ App.Presenters.PostPresenter = function( $prevPost.removeAttr('href'); keyboard.unbind('d'); } + }).fail(function() { }); } diff --git a/public_html/js/Services/PostsAroundCalculator.js b/public_html/js/Services/PostsAroundCalculator.js index f4f86ef0..19aa9fd4 100644 --- a/public_html/js/Services/PostsAroundCalculator.js +++ b/public_html/js/Services/PostsAroundCalculator.js @@ -27,7 +27,11 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) { getLinkToPostAround(postIds, position, query.page, 1)) .then(function(nextPostUrl, prevPostUrl) { resolve(nextPostUrl, prevPostUrl); + }).fail(function() { + reject(); }); + }).fail(function() { + reject(); }); }); } @@ -41,20 +45,23 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) { resolve(url); } else if (page + direction >= 1) { pager.setPage(page + direction); - promise.wait(pager.retrieveCached()).then(function(response) { - if (response.entities.length) { - var post = direction === - 1 ? - _.last(response.entities) : - _.first(response.entities); + promise.wait(pager.retrieveCached()) + .then(function(response) { + if (response.entities.length) { + var post = direction === - 1 ? + _.last(response.entities) : + _.first(response.entities); - var url = util.appendComplexRouteParam( - '#/post/' + post.id, - _.extend({page: page + direction}, pager.getSearchParams())); - resolve(url); - } else { - resolve(null); - } - }); + var url = util.appendComplexRouteParam( + '#/post/' + post.id, + _.extend({page: page + direction}, pager.getSearchParams())); + resolve(url); + } else { + resolve(null); + } + }).fail(function() { + reject(); + }); } else { resolve(null); }