remove dialogs with state

This commit is contained in:
rolux 2011-11-04 18:10:48 +00:00
parent 50e5c6b760
commit d3225ad4af
6 changed files with 14 additions and 17 deletions

View file

@ -34,8 +34,8 @@ class List(models.Model):
icon = models.ImageField(default=None, blank=True,
upload_to=lambda i, x: i.path("icon.jpg"))
view = models.TextField(default=settings.CONFIG['user']['ui']['listView'])
sort = TupleField(default=settings.CONFIG['user']['ui']['listSort'], editable=False)
view = models.TextField(default=lambda: settings.CONFIG['user']['ui']['listView'])
sort = TupleField(default=lambda: settings.CONFIG['user']['ui']['listSort'], editable=False)
poster_frames = TupleField(default=[], editable=False)

View file

@ -11,6 +11,8 @@ from django.conf import settings
from django.contrib import admin
admin.autodiscover()
import monkey_patch.models
from api import actions
actions.autodiscover()

View file

@ -134,9 +134,7 @@ pandora.URL = (function() {
) {
pandora.$ui.siteDialog = pandora.ui.siteDialog(state.page).open();
} else if (state.page == 'help') {
(pandora.$ui.helpDialog || (
pandora.$ui.helpDialog = pandora.ui.helpDialog()
)).open();
pandora.$ui.helpDialog = pandora.ui.helpDialog().open();
} else if (['signup', 'signin'].indexOf(state.page) > -1) {
if (pandora.user.level == 'guest') {
pandora.$ui.accountDialog = pandora.ui.accountDialog(state.page).open();

View file

@ -54,7 +54,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
id: 'cancel' + Ox.toTitleCase(action),
title: 'Cancel'
}).bindEvent('click', function() {
pandora.$ui.accountDialog.close();
pandora.$ui.accountDialog.close().remove();
pandora.URL.update();
});
} else if (type == 'submit') {
@ -140,7 +140,7 @@ pandora.ui.accountForm = function(action, value) {
if (action == 'signin') {
pandora.api.signin(data, function(result) {
if (!result.data.errors) {
pandora.$ui.accountDialog.close();
pandora.$ui.accountDialog.close().remove();
pandora.signin(result.data);
} else {
pandora.$ui.accountDialog.enableButtons();
@ -150,7 +150,7 @@ pandora.ui.accountForm = function(action, value) {
} else if (action == 'signup') {
pandora.api.signup(data, function(result) {
if (!result.data.errors) {
pandora.$ui.accountDialog.close();
pandora.$ui.accountDialog.close().remove();
pandora.signin(result.data);
pandora.ui.accountWelcomeDialog().open();
} else {
@ -174,7 +174,7 @@ pandora.ui.accountForm = function(action, value) {
} else if (action == 'resetAndSignin') {
pandora.api.resetPassword(data, function(result) {
if (!result.data.errors) {
pandora.$ui.accountDialog.close();
pandora.$ui.accountDialog.close().remove();
pandora.signin(result.data);
} else {
pandora.$ui.accountDialog.enableButtons();
@ -320,14 +320,14 @@ pandora.ui.accountSignoutDialog = function() {
id: 'cancel',
title: 'Cancel'
}).bindEvent('click', function() {
that.close();
that.close().remove();
pandora.URL.update();
}),
Ox.Button({
id: 'signout',
title: 'Sign Out'
}).bindEvent('click', function() {
that.close();
that.close().remove();
pandora.api.signout({}, function(result) {
pandora.signout(result.data);
});
@ -360,7 +360,7 @@ pandora.ui.accountWelcomeDialog = function() {
id: 'preferences',
title: 'Preferences...'
}).bindEvent('click', function() {
that.close();
that.close().remove();
pandora.$ui.preferencesDialog = pandora.ui.preferencesDialog().open();
}),
{},
@ -368,7 +368,7 @@ pandora.ui.accountWelcomeDialog = function() {
id: 'close',
title: 'Close'
}).bindEvent('click', function() {
that.close();
that.close().remove();
})
],
content: Ox.Element()

View file

@ -8,7 +8,7 @@ pandora.ui.helpDialog = function() {
title: 'Close'
}).bindEvent({
click: function() {
that.close();
that.close().remove();
//fixme: this should be using URL.push / UI.set
//but that currenlty causes a reload
history.pushState({}, '', '/');

View file

@ -86,9 +86,6 @@ pandora.ui.logsDialog = function() {
{
id: 'text',
title: 'Text',
tooltip: function(data) {
return $('<code>').append($('<pre>').append(data.text));
},
visible: true,
width: 640
},