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

View file

@ -632,7 +632,9 @@ pandora.isClipView = function(view, item) {
pandora.signin = function(data) { pandora.signin = function(data) {
pandora.user = data.user; 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); Ox.Theme(pandora.user.ui.theme);
pandora.UI.set({find: pandora.user.ui.find}) pandora.UI.set({find: pandora.user.ui.find})
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
@ -640,7 +642,9 @@ pandora.signin = function(data) {
pandora.signout = function(data) { pandora.signout = function(data) {
pandora.user = data.user; 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); Ox.Theme(pandora.site.user.ui.theme);
pandora.UI.set({find: pandora.user.ui.find}) pandora.UI.set({find: pandora.user.ui.find})
pandora.$ui.appPanel.reload(); pandora.$ui.appPanel.reload();
@ -738,7 +742,7 @@ pandora.selectList = function() {
(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) { function everyCondition(conditions, key, operator) {
// If every condition has the given key and operator // If every condition has the given key and operator