improve advanced find

This commit is contained in:
rolux 2011-11-04 12:13:04 +00:00
parent fb1722cb42
commit cedaad813e
2 changed files with 13 additions and 6 deletions

View file

@ -45,10 +45,14 @@ pandora.ui.findElement = function() {
change: function(data) { change: function(data) {
var key = data.selected[0].id; var key = data.selected[0].id;
if (key == 'advanced') { if (key == 'advanced') {
pandora.$ui.filterDialog = pandora.ui.filterDialog().open(); pandora.$ui.findInput.options({
pandora.$ui.findInput.options({placeholder: 'Edit...'}) placeholder: 'Edit Query...',
value: ''
});
(pandora.$ui.filterDialog || (
pandora.$ui.filterDialog = pandora.ui.filterDialog()
)).open();
} else { } else {
pandora.$ui.mainMenu.checkItem('findMenu_find_' + key);
pandora.$ui.findInput.options({ pandora.$ui.findInput.options({
autocomplete: autocompleteFunction(), autocomplete: autocompleteFunction(),
placeholder: '' placeholder: ''
@ -64,14 +68,17 @@ pandora.ui.findElement = function() {
autocompleteSelectSubmit: true, autocompleteSelectSubmit: true,
clear: true, clear: true,
id: 'input', id: 'input',
placeholder: findKey == 'advanced' ? 'Edit...' : '', placeholder: findKey == 'advanced' ? 'Edit Query...' : '',
value: findValue, value: findValue,
width: 192 width: 192
}) })
.bindEvent({ .bindEvent({
focus: function(data) { focus: function(data) {
if (pandora.$ui.findSelect.value() == 'advanced') { if (pandora.$ui.findSelect.value() == 'advanced') {
pandora.$ui.filterDialog = pandora.ui.filterDialog().open(); pandora.$ui.findInput.blurInput();
(pandora.$ui.filterDialog || (
pandora.$ui.filterDialog = pandora.ui.filterDialog()
)).open();
} }
}, },
submit: function(data) { submit: function(data) {

View file

@ -178,7 +178,7 @@ pandora.ui.infoView = function(data) {
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
editable: isEditable, editable: isEditable,
format: function(value) { format: function(value) {
formatValue(value.split(', '), 'name') return formatValue(value.split(', '), 'name');
}, },
placeholder: formatLight('Unknown Director'), placeholder: formatLight('Unknown Director'),
tooltip: isEditable ? 'Doubleclick to edit' : '', tooltip: isEditable ? 'Doubleclick to edit' : '',