From 6e44c9021aad6e91eb655f80a8ae0e0b742bcb59 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 8 Aug 2013 11:15:23 +0000 Subject: [PATCH] close (not remove) dialog --- static/js/preferencesDialog.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/preferencesDialog.js b/static/js/preferencesDialog.js index 4d714128..e8e503ce 100644 --- a/static/js/preferencesDialog.js +++ b/static/js/preferencesDialog.js @@ -2,7 +2,8 @@ pandora.ui.preferencesDialog = function() { - var tabs = [ + var isReloading = false, + tabs = [ {id: 'account', title: Ox._('Account')}, {id: 'appearance', title: Ox._('Appearance')}, {id: 'advanced', title: Ox._('Advanced')} @@ -133,7 +134,8 @@ pandora.ui.preferencesDialog = function() { change: function(data) { pandora.UI.set({locale: data.value}); pandora.setLocale(data.value, function() { - $dialog.remove(); + isReloading = true; + $dialog.close(); pandora.$ui.appPanel.reload(); }); } @@ -207,7 +209,9 @@ pandora.ui.preferencesDialog = function() { }) .bindEvent({ close: function() { - pandora.user.ui.page == 'preferences' && pandora.UI.set({page: ''}); + if (pandora.user.ui.page == 'preferences' && !isReloading) { + pandora.UI.set({page: ''}); + } }, 'pandora_part.preferences': function(data) { if (pandora.user.ui.page == 'preferences') {