From 8db6a6c3d03fb6837a5565b0ef6291ad6ba1388c Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 10 Jan 2011 00:07:18 +0000 Subject: [PATCH] when selecting list, deselect lists in other sections --- static/js/pandora.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/static/js/pandora.js b/static/js/pandora.js index 8e33a28..ba6a8d9 100755 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -2103,6 +2103,7 @@ var pandora = new Ox.App({ sections: function() { var that = new Ox.Element(); var $sections = []; + app.$ui.sectionLists = []; $.each(app.user.ui.sections, function(i, id) { var menu = []; if (id == 'my') { @@ -2129,7 +2130,7 @@ var pandora = new Ox.App({ $section.$content.css({ height: app.user.lists[id].length * 16 + 'px' }); - var $list = new Ox.TextList({ + app.$ui.sectionLists[i] = new Ox.TextList({ columns: [ { align: 'left', @@ -2198,21 +2199,14 @@ var pandora = new Ox.App({ width: app.user.ui.sidebarSize + 'px', height: app.user.lists[id].length * 16 + 'px' }) + .bindEvent('select', function(event, data) { + app.$ui.sectionLists.forEach(function($list, i_) { + if (i != i_) { + $list.options('selected', []); + } + }); + }) .appendTo($section.$content); - /* - } else { - $section.$content.append( - $('
').css({ height: '20px' }).append( - $('
').css({ float: 'left', width: '16px', height: '16px', margin: '1px'}).append( - $('').attr({ src: 'static/oxjs/build/png/ox.ui.modern/iconFind.png' }).css({ width: '16px', height: '16px', border: 0, background: 'rgb(64, 64, 64)', WebkitBorderRadius: '2px' }) - ) - ).append( - $('
').css({ float: 'left', width: '122px', height: '14px', margin: '2px' }).html('Foo') - ).append( - $('
').css({ float: 'left', width: '40px', height: '14px', margin: '2px', textAlign: 'right' }).html('23') - ) - ); - } */ }); $.each($sections, function(i, $section) { that.append($section);