mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
(WIP) Added spinner (#39)
This commit is contained in:
@ -11,16 +11,19 @@ App.Presenters.LogoutPresenter = function(
|
||||
|
||||
var $messages = jQuery('#content');
|
||||
|
||||
function init() {
|
||||
function init(args, loaded) {
|
||||
topNavigationPresenter.select('logout');
|
||||
topNavigationPresenter.changeTitle('Logout');
|
||||
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);
|
||||
}).fail(function(response) {
|
||||
messagePresenter.showError(($messages, response.json && response.json.error || response) + '<br/>Reload the page to continue.');
|
||||
});
|
||||
promise.wait(auth.logout())
|
||||
.then(function() {
|
||||
loaded();
|
||||
$messages.empty();
|
||||
var $messageDiv = messagePresenter.showInfo($messages, 'Logged out. <a href="">Back to main page</a>');
|
||||
$messageDiv.find('a').click(mainPageLinkClicked);
|
||||
}).fail(function(response) {
|
||||
loaded();
|
||||
messagePresenter.showError(($messages, response.json && response.json.error || response) + '<br/>Reload the page to continue.');
|
||||
});
|
||||
}
|
||||
|
||||
function mainPageLinkClicked(e) {
|
||||
|
Reference in New Issue
Block a user