fix errors when signing in or out

This commit is contained in:
rolux 2011-10-08 15:16:22 +00:00
parent c63677fd1f
commit 41f6ca478c
2 changed files with 43 additions and 38 deletions

View file

@ -52,6 +52,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
title: 'Cancel'
}).bindEvent('click', function() {
pandora.$ui.accountDialog.close();
pandora.URL.update();
});
} else if (type == 'submit') {
return Ox.Button({
@ -305,41 +306,41 @@ pandora.ui.accountForm = function(action, value) {
pandora.ui.accountSignoutDialog = function() {
var that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'cancel',
title: 'Cancel'
}).bindEvent('click', function() {
that.close();
pandora.$ui.mainMenu.getItem('signinsignout').toggleTitle();
}),
Ox.Button({
id: 'signout',
title: 'Sign Out'
}).bindEvent('click', function() {
that.close();
pandora.api.signout({}, function(result) {
pandora.signout(result.data);
});
})
],
content: Ox.Element()
.append(
$('<img>')
.attr({src: '/static/png/icon64.png'})
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
)
.append(
$('<div>')
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
.html('Are you sure you want to sign out?')
),
fixedSize: true,
height: 128,
keys: {enter: 'signout', escape: 'cancel'},
title: 'Sign Out',
width: 304
});
buttons: [
Ox.Button({
id: 'cancel',
title: 'Cancel'
}).bindEvent('click', function() {
that.close();
pandora.URL.update();
}),
Ox.Button({
id: 'signout',
title: 'Sign Out'
}).bindEvent('click', function() {
that.close();
pandora.api.signout({}, function(result) {
pandora.signout(result.data);
});
})
],
content: Ox.Element()
.append(
$('<img>')
.attr({src: '/static/png/icon64.png'})
.css({position: 'absolute', left: '16px', top: '16px', width: '64px', height: '64px'})
)
.append(
$('<div>')
.css({position: 'absolute', left: '96px', top: '16px', width: '192px'})
.html('Are you sure you want to sign out?')
),
fixedSize: true,
height: 128,
keys: {enter: 'signout', escape: 'cancel'},
title: 'Sign Out',
width: 304
});
return that;
};

View file

@ -632,7 +632,9 @@ pandora.isClipView = function(view, item) {
pandora.signin = function(data) {
pandora.user = data.user;
pandora.Query.updateGroups();
pandora.user.ui._list = pandora.getListsState(pandora.user.ui.find);
pandora.user.ui._groupsState = pandora.getGroupsState(pandora.user.ui.find);
pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
Ox.Theme(pandora.user.ui.theme);
pandora.UI.set({find: pandora.user.ui.find})
pandora.$ui.appPanel.reload();
@ -640,7 +642,9 @@ pandora.signin = function(data) {
pandora.signout = function(data) {
pandora.user = data.user;
pandora.Query.updateGroups();
pandora.user.ui._list = pandora.getListsState(pandora.user.ui.find);
pandora.user.ui._groupsState = pandora.getGroupsState(pandora.user.ui.find);
pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
Ox.Theme(pandora.site.user.ui.theme);
pandora.UI.set({find: pandora.user.ui.find})
pandora.$ui.appPanel.reload();
@ -738,7 +742,7 @@ pandora.selectList = function() {
(function() {
// Note: getFindState has to run after getListState and getGroupsState
// Note: getFindState has to run after getListsState and getGroupsState
function everyCondition(conditions, key, operator) {
// If every condition has the given key and operator