forked from 0x2620/pandora
correctly set find state when loading '/'
This commit is contained in:
parent
8dedbd1bae
commit
746efb3110
6 changed files with 27 additions and 15 deletions
|
@ -500,6 +500,7 @@
|
|||
{"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."}
|
||||
],
|
||||
"sendReferrer": false,
|
||||
"site": {
|
||||
"id": "{{settings.SITEID}}",
|
||||
"name": "{{settings.SITENAME}}",
|
||||
|
|
|
@ -42,6 +42,11 @@ Ox.load({
|
|||
|
||||
if (!browserSupported) {
|
||||
return;
|
||||
/*
|
||||
$('.OxLoadingScreen')
|
||||
.css({opacity: 0.9})
|
||||
.click($(this).remove);
|
||||
*/
|
||||
}
|
||||
|
||||
Ox.extend(pandora, {
|
||||
|
|
|
@ -112,12 +112,10 @@ pandora.URL = (function() {
|
|||
|
||||
if (pandora.user.ui.showHome) {
|
||||
pandora.$ui.home = pandora.ui.home().showScreen();
|
||||
/*
|
||||
Ox.print('LIST', pandora.user.ui._list)
|
||||
pandora.user.ui._list && pandora.Query.fromString(
|
||||
'find=list:' + pandora.user.ui._list
|
||||
);
|
||||
*/
|
||||
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);
|
||||
|
||||
} else {
|
||||
/*
|
||||
pandora.UI.set({
|
||||
|
|
|
@ -78,7 +78,9 @@ pandora.ui.group = function(id) {
|
|||
pandora.$ui.list.triggerEvent('paste', 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) {
|
||||
return {
|
||||
key: id,
|
||||
|
|
|
@ -390,14 +390,7 @@ pandora.ui.infoView = function(data) {
|
|||
}).join(', ');
|
||||
}
|
||||
|
||||
$text.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.createLinks($text);
|
||||
|
||||
function renderList() {
|
||||
pandora.api.get({
|
||||
|
|
|
@ -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) {
|
||||
|
||||
var $tooltip = Ox.Tooltip({
|
||||
|
@ -774,6 +785,8 @@ pandora.selectList = function() {
|
|||
// are either list or groups), or if all conditions in an | query have
|
||||
// the same group id as key and "==" as operator
|
||||
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: ''};
|
||||
if (find.operator == '&') {
|
||||
// number of conditions that are not list or groups
|
||||
|
|
Loading…
Reference in a new issue