correctly set find state when loading '/'

This commit is contained in:
rolux 2011-10-09 10:04:30 +00:00
parent 8dedbd1bae
commit 746efb3110
6 changed files with 27 additions and 15 deletions

View file

@ -500,6 +500,7 @@
{"name": "Restricted", "color": [255, 128, 0], "description": "Only staff and admin can see and play."}, {"name": "Restricted", "color": [255, 128, 0], "description": "Only staff and admin can see and play."},
{"name": "Private", "color": [255, 0, 0], "description": "Only admins can see and play."} {"name": "Private", "color": [255, 0, 0], "description": "Only admins can see and play."}
], ],
"sendReferrer": false,
"site": { "site": {
"id": "{{settings.SITEID}}", "id": "{{settings.SITEID}}",
"name": "{{settings.SITENAME}}", "name": "{{settings.SITENAME}}",

View file

@ -42,6 +42,11 @@ Ox.load({
if (!browserSupported) { if (!browserSupported) {
return; return;
/*
$('.OxLoadingScreen')
.css({opacity: 0.9})
.click($(this).remove);
*/
} }
Ox.extend(pandora, { Ox.extend(pandora, {

View file

@ -112,12 +112,10 @@ pandora.URL = (function() {
if (pandora.user.ui.showHome) { if (pandora.user.ui.showHome) {
pandora.$ui.home = pandora.ui.home().showScreen(); pandora.$ui.home = pandora.ui.home().showScreen();
/* pandora.user.ui._list = pandora.getListsState(pandora.user.ui.find);
Ox.print('LIST', pandora.user.ui._list) pandora.user.ui._groupsState = pandora.getGroupsState(pandora.user.ui.find);
pandora.user.ui._list && pandora.Query.fromString( pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find);
'find=list:' + pandora.user.ui._list
);
*/
} else { } else {
/* /*
pandora.UI.set({ pandora.UI.set({

View file

@ -78,7 +78,9 @@ pandora.ui.group = function(id) {
pandora.$ui.list.triggerEvent('paste', data); pandora.$ui.list.triggerEvent('paste', data);
}, },
select: function(data) { select: function(data) {
// FIXME: cant index be an empty array, instead of -1? // fixme: cant index be an empty array, instead of -1?
// FIXME: this is still incorrect when deselecting a group item
// makes a selected item in another group disappear
var conditions = data.ids.map(function(value) { var conditions = data.ids.map(function(value) {
return { return {
key: id, key: id,

View file

@ -390,14 +390,7 @@ pandora.ui.infoView = function(data) {
}).join(', '); }).join(', ');
} }
$text.find('a').click(function(event) { pandora.createLinks($text);
if (event.target.hostname == document.location.hostname) {
pandora.URL.push(event.target.pathname);
} else {
document.location.href = '/url=' + encodeURIComponent(event.target.href);
}
return false;
});
function renderList() { function renderList() {
pandora.api.get({ pandora.api.get({

View file

@ -134,6 +134,17 @@ pandora.addList = function() {
} }
}; };
pandora.createLinks = function($element) {
$element.find('a').click(function(event) {
if (event.target.hostname == document.location.hostname) {
pandora.URL.push(event.target.pathname);
} else {
document.location.href = '/url=' + encodeURIComponent(event.target.href);
}
return false;
});
};
pandora.enableDragAndDrop = function($list, canMove) { pandora.enableDragAndDrop = function($list, canMove) {
var $tooltip = Ox.Tooltip({ var $tooltip = Ox.Tooltip({
@ -774,6 +785,8 @@ pandora.selectList = function() {
// are either list or groups), or if all conditions in an | query have // are either list or groups), or if all conditions in an | query have
// the same group id as key and "==" as operator // the same group id as key and "==" as operator
Ox.print('getFindState', find) Ox.print('getFindState', find)
// FIXME: this is still incorrect when you select a lot of group items
// and reload the page (will be advanced)
var conditions, indices, state = {index: -1, key: '*', value: ''}; var conditions, indices, state = {index: -1, key: '*', value: ''};
if (find.operator == '&') { if (find.operator == '&') {
// number of conditions that are not list or groups // number of conditions that are not list or groups