From bad8ddb7b865d8e638dece8594a9eed103c9a6d0 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 5 Sep 2011 01:30:05 +0000 Subject: [PATCH] spring-loaded left panel --- static/js/pandora/pandora.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/static/js/pandora/pandora.js b/static/js/pandora/pandora.js index f45eb80..9c4f1b1 100644 --- a/static/js/pandora/pandora.js +++ b/static/js/pandora/pandora.js @@ -41,22 +41,31 @@ pandora.enableDragAndDrop = function($list, canMove) { }); }, draganddrop: function(data) { + Ox.print(pandora.$ui.folders.$element.scrollTop(0)); $tooltip.options({ title: getTitle(data._event) }).show(data._event); }, draganddroppause: function(data) { - var $parent = $(data._event.target).parent(), - $grandparent = $parent.parent(), + var event = data._event, + $parent, $grandparent, $panel, $bar, title; + if ( + // fixme: should be named showLists in the user ui prefs! + !pandora.user.ui.showSidebar && event.clientX < 16 + && event.clientY >= 44 && event.clientY < window.innerHeight - 16 + ) { + pandora.$ui.mainPanel.toggle(0); + } else { + $parent = $(data._event.target).parent(); + $grandparent = $parent.parent(); $panel = $parent.is('.OxCollapsePanel') ? $parent - : $grandparent.is('.OxCollapsePanel') ? $grandparent : null, - $bar, - title; - if ($panel) { - $bar = $panel.children('.OxBar'); - title = $bar.children('.OxTitle') - .html().split(' ')[0].toLowerCase(); - !pandora.user.ui.showFolder.items[title] && $bar.trigger('dblclick'); + : $grandparent.is('.OxCollapsePanel') ? $grandparent : null; + if ($panel) { + $bar = $panel.children('.OxBar'); + title = $bar.children('.OxTitle') + .html().split(' ')[0].toLowerCase(); + !pandora.user.ui.showFolder.items[title] && $bar.trigger('dblclick'); + } } }, draganddropenter: function(data) {