From 5f4eecb8d0bd41024b7d7d6591b176f291e4b17a Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 1 Sep 2011 07:43:32 +0000 Subject: [PATCH] add find-as-you-type to list browsers --- static/js/pandora/ui/folderBrowserBar.js | 6 ++++-- static/js/pandora/ui/folderBrowserList.js | 4 ++-- static/js/pandora/ui/foldersList.js | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/static/js/pandora/ui/folderBrowserBar.js b/static/js/pandora/ui/folderBrowserBar.js index bc6df0e..9450e66 100644 --- a/static/js/pandora/ui/folderBrowserBar.js +++ b/static/js/pandora/ui/folderBrowserBar.js @@ -3,7 +3,6 @@ pandora.ui.folderBrowserBar = function(id) { var that = Ox.Bar({ size: 24 }); - Ox.print('ID', id) pandora.$ui.findListElement[id] = Ox.FormElementGroup({ elements: [ pandora.$ui.findListSelect[id] = Ox.Select({ @@ -22,12 +21,14 @@ pandora.ui.folderBrowserBar = function(id) { } }), pandora.$ui.findListInput[id] = Ox.Input({ + changeOnKeypress: true, clear: true, placeholder: 'Find: User', width: pandora.getFoldersWidth() - 24 }) .bindEvent({ - submit: function(data) { + change: function(data) { + Ox.print('ID::', id) var key = pandora.$ui.findListSelect[id].value() == 'user' ? 'user' : 'name', value = data.value; pandora.$ui.folderList[id].options({ @@ -55,6 +56,7 @@ pandora.ui.folderBrowserBar = function(id) { align: 'right' }) .appendTo(that); + return that; }; diff --git a/static/js/pandora/ui/folderBrowserList.js b/static/js/pandora/ui/folderBrowserList.js index 53fd8b1..19e2e77 100644 --- a/static/js/pandora/ui/folderBrowserList.js +++ b/static/js/pandora/ui/folderBrowserList.js @@ -55,7 +55,7 @@ pandora.ui.folderBrowserList = function(id) { }, { clickable: function(data) { - return data.type == 'smart'; + return data.type == 'smart' || data.user == pandora.user.username; }, format: function(value, data) { return $('') @@ -83,7 +83,7 @@ pandora.ui.folderBrowserList = function(id) { tooltip: function(data) { return data.type == 'smart' ? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query') - : ''; + : (data.user == pandora.user.username ? 'Edit Default View' : 'Default View: ...'); }, visible: true, width: 16 diff --git a/static/js/pandora/ui/foldersList.js b/static/js/pandora/ui/foldersList.js index c490a66..543887c 100644 --- a/static/js/pandora/ui/foldersList.js +++ b/static/js/pandora/ui/foldersList.js @@ -42,7 +42,7 @@ pandora.ui.folderList = function(id) { autovalidate: pandora.ui.autovalidateListname }, operator: '+', - tooltip: id == 'personal' ? 'Edit Title' : null, + tooltip: id == 'personal' ? 'Edit Title' : '', visible: id != 'favorite', width: pandora.user.ui.sidebarWidth - 96 }, @@ -56,7 +56,7 @@ pandora.ui.folderList = function(id) { }, { clickable: function(data) { - return data.type == 'smart'; + return data.type == 'smart' || data.user == pandora.user.username; }, format: function(value, data) { return $('') @@ -75,7 +75,7 @@ pandora.ui.folderList = function(id) { tooltip: function(data) { return data.type == 'smart' ? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query') - : ''; + : (data.user == pandora.user.username ? 'Edit Default View' : 'Default View: ...'); }, visible: true, width: 16