close (not remove) dialog

This commit is contained in:
rolux 2013-08-08 11:15:23 +00:00
parent 62af7f05a5
commit 6e44c9021a
1 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,8 @@
pandora.ui.preferencesDialog = function() { pandora.ui.preferencesDialog = function() {
var tabs = [ var isReloading = false,
tabs = [
{id: 'account', title: Ox._('Account')}, {id: 'account', title: Ox._('Account')},
{id: 'appearance', title: Ox._('Appearance')}, {id: 'appearance', title: Ox._('Appearance')},
{id: 'advanced', title: Ox._('Advanced')} {id: 'advanced', title: Ox._('Advanced')}
@ -133,7 +134,8 @@ pandora.ui.preferencesDialog = function() {
change: function(data) { change: function(data) {
pandora.UI.set({locale: data.value}); pandora.UI.set({locale: data.value});
pandora.setLocale(data.value, function() { pandora.setLocale(data.value, function() {
$dialog.remove(); isReloading = true;
$dialog.close();
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
}); });
} }
@ -207,7 +209,9 @@ pandora.ui.preferencesDialog = function() {
}) })
.bindEvent({ .bindEvent({
close: function() { 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) { 'pandora_part.preferences': function(data) {
if (pandora.user.ui.page == 'preferences') { if (pandora.user.ui.page == 'preferences') {