From e0d7b59cbb862d8bcf1fe5d6022666612391e2f3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 5 Jul 2010 14:35:51 +0200 Subject: [PATCH] remove autocomplete --- pandora/static/js/pandora.js | 53 ++---------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/pandora/static/js/pandora.js b/pandora/static/js/pandora.js index d35a96776..a89afa6cc 100644 --- a/pandora/static/js/pandora.js +++ b/pandora/static/js/pandora.js @@ -1,6 +1,6 @@ $(function(){ Ox.debug = Ox.print; - Ox.print = function() {}; + //Ox.print = function() {}; Ox.theme("modern"); app = new Ox.App({ @@ -49,54 +49,7 @@ $(function(){ .css({ marginLeft: "4px" }); - app.menu = new Ox.MainMenu({ - extras: [ - new Ox.Input({ - autocomplete: function(option, value, callback) { - var field = option.substring(6).toLowerCase(); - if(typeof(callback) == 'undefined') { - callback = value; - value = null; - } - Ox.debug('app.menu.find.autocomplete: option: ', option, 'value: ', value, ', callback:',callback); - Ox.debug('app.menu.find.autocomplete: field: ', field); - if(field == 'all') { - callback([]); - } else if (value) { - value = value.toLowerCase(); - //var order = $.inArray(field, ['year', 'date'])?'-':''; - app.request('find', { - query: { - conditions: [ - { - key: field, - value: value, - operator: '~' - } - ] - }, - list: 'all', - sort: [{key:field, operator: ''}], - keys: [field], - range: [0, 10] - }, function(result) { - var items = $.map( - result.data.items, - function(item, i) { return item.title; } - ); - callback(items); - }); - } - }, - clear: true, - highlight: false, - id: "find", - label: ["Find: Title", "Find: All", "Find: Director", "Find: Country", "Find: Cinematographer"], - labelWidth: 96 - }).width(320), - loadingIcon - ], menus: [ { id: "pandoraMM", @@ -314,6 +267,7 @@ $(function(){ app.menu.bindEvent('click_logout', function(event, data) { app.logout(); }); + app.menu.bindEvent('click_login', function(element) { var labelWidth = 64; var inputWidth = labelWidth+200; @@ -390,7 +344,6 @@ $(function(){ .append(d) .open(); }); - var bottomPanel = Ox.Toolbar({size: "small"}) .css({ zIndex: 2, @@ -497,7 +450,7 @@ $(function(){ }] }).appendTo(content); - app.bindEvent('submit_find', function(event, data) { + app.menu.bindEvent('submit_find', function(event, data) { app.results.options({ request: function(options) { app.request("find", $.extend(options, {