Fixed promises on Internet Explorer

This commit is contained in:
Marcin Kurczewski
2014-09-04 18:06:25 +02:00
parent ee9fde5402
commit 840039958a
12 changed files with 112 additions and 77 deletions

View File

@ -6,17 +6,18 @@ App.Presenters.LogoutPresenter = function(
topNavigationPresenter,
messagePresenter,
auth,
promise,
router) {
var $messages = jQuery('#content');
function init() {
topNavigationPresenter.select('logout');
auth.logout().then(function() {
promise.wait(auth.logout()).then(function() {
$messages.empty();
var $messageDiv = messagePresenter.showInfo($messages, 'Logged out. <a href="">Back to main page</a>');
$messageDiv.find('a').click(mainPageLinkClicked);
}).catch(function(response) {
}).fail(function(response) {
messagePresenter.showError($messages, response.json && response.json.error || response);
});
}