update advanced find

This commit is contained in:
rolux 2011-11-10 22:48:32 +00:00
parent 72c0917d2c
commit 2d7d0414f9
3 changed files with 66 additions and 64 deletions

View file

@ -3,24 +3,13 @@
pandora.ui.filterDialog = function(list) {
var that = Ox.Dialog({
buttons: [
/*
Ox.Button({
id: 'cancel',
title: 'Cancel'
})
.bindEvent({
click: function() {
pandora.$ui.filterDialog.close();
}
}),
*/
Ox.Button({
id: 'done',
title: 'Done'
})
.bindEvent({
click: function() {
pandora.$ui.filterDialog.close();
that.close();
}
})
],
@ -30,6 +19,7 @@ pandora.ui.filterDialog = function(list) {
minWidth: 648 + Ox.UI.SCROLLBAR_SIZE,
height: 264,
// keys: {enter: 'save', escape: 'cancel'},
removeOnClose: true,
title: list ? 'Smart List - ' + list.name : 'Advanced Find',
width: 648 + Ox.UI.SCROLLBAR_SIZE
});

View file

@ -3,7 +3,18 @@
'use strict';
pandora.ui.filterForm = function(list) {
var that = Ox.Filter({
var that = Ox.Element();
pandora.api.findLists({
query: {
conditions: [{key: 'type', value: 'static', operator: '='}],
operator: '&'
},
keys: ['id'],
range: [0, 1000],
sort: [{key: 'user', operator: '+'}, {key: 'name', operator: '+'}]
}, function(result) {
that.append(
Ox.Filter({
findKeys: Ox.merge(Ox.map(pandora.site.itemKeys, function(itemKey) {
var key = Ox.clone(itemKey);
key.type = key.type == 'layer'
@ -13,7 +24,10 @@ pandora.ui.filterForm = function(list) {
}), {
id: 'list',
title: 'List',
type: 'string'
type: 'list',
values: result.data.items.map(function(item) {
return item.id;
})
}),
list: list ? null : {
sort: pandora.user.ui.listSort,
@ -50,6 +64,8 @@ pandora.ui.filterForm = function(list) {
pandora.UI.set({find: Ox.clone(data.query, true)});
}
}
})
);
});
return that;
};

View file

@ -52,9 +52,7 @@ pandora.ui.findElement = function() {
placeholder: 'Edit Query...',
value: ''
});
(pandora.$ui.filterDialog || (
pandora.$ui.filterDialog = pandora.ui.filterDialog()
)).open();
pandora.$ui.filterDialog = pandora.ui.filterDialog().open();
} else {
Ox.Log('FIND', pandora.$ui.findInput.value())
pandora.$ui.findInput.options({
@ -80,9 +78,7 @@ pandora.ui.findElement = function() {
focus: function(data) {
if (pandora.$ui.findSelect.value() == 'advanced') {
pandora.$ui.findInput.blurInput();
(pandora.$ui.filterDialog || (
pandora.$ui.filterDialog = pandora.ui.filterDialog()
)).open();
pandora.$ui.filterDialog = pandora.ui.filterDialog().open();
}
},
submit: function(data) {