diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-07-15 13:27:39 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-07-15 13:27:39 +0300 |
| commit | 0a8c9ec6b5d341850d3005f7c92c6ecfdebe4a62 (patch) | |
| tree | ba17930184d3cd051d9b26334f35cc63f9234460 | |
| parent | aed682429bd8b2a0b5edbb6aa06954c25f9df143 (diff) | |
Fix logout flow
| -rw-r--r-- | client/button.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/client/button.js b/client/button.js index 84c7208..f1f9123 100644 --- a/client/button.js +++ b/client/button.js @@ -174,11 +174,18 @@ function animate2() { } +function doLogout() { + $('body').append('<div style="display:none;"><iframe src="https://instagram.com/accounts/logout"></iframe></div>'); + $('div.header img.profile').attr('src', 'https://instagramimages-a.akamaihd.net/profiles/anonymousUser.jpg'); + Meteor.logout(); + _.delay(function () { + Router.go('login'); + }, 500); +} + Template.layout.events({ 'click .logout': function (event) { - Meteor.logout(); - $('div.header img.profile').attr('src', 'https://instagramimages-a.akamaihd.net/profiles/anonymousUser.jpg'); - Router.go('login'); + doLogout(); } }) @@ -192,16 +199,6 @@ Template.login.events({ } }); -Template.layout.events({ - 'click a.logout': function (event) { - $('body').append('<div style="display:none;"><iframe src="https://instagram.com/accounts/logout"></iframe></div>'); - Meteor.logout(); - _.delay(function () { - Router.go('login'); - }, 500); - } -}) - Template.dates.events({ 'scroll .month-wrapper': function (e) { var elements = $('.month-wrapper').find('.month').length; @@ -332,6 +329,11 @@ Template.photos.events({ printStr += bin2hex([1,1,1].concat(code)); // add three high bits for padding Meteor.call('printFinalImage', printStr); + + _.delay(function () { + doLogout(); + }, 1000); + return false; } }) |
