From 7986b2487cfd276064036d1e551507957958f44a Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 8 Jul 2013 11:30:33 +0000 Subject: [PATCH] add doubleclick-on-title-bar-to-scroll-up-list functionality to item clips view, map/calendar clips list, folders, lists and context browser --- static/js/pandora/clipsView.js | 7 +++++++ static/js/pandora/navigationView.js | 9 ++++++++- static/js/pandora/sectionbar.js | 12 ++++++++---- static/js/pandora/toolbar.js | 9 +++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/static/js/pandora/clipsView.js b/static/js/pandora/clipsView.js index 5ae28ac6..f914237c 100644 --- a/static/js/pandora/clipsView.js +++ b/static/js/pandora/clipsView.js @@ -17,6 +17,13 @@ pandora.ui.clipsView = function(videoRatio) { elements: [ { element: Ox.Bar({size: 24}) + .bindEvent({ + doubleclick: function(e) { + if ($(e.target).is('.OxBar')) { + pandora.$ui.clipList.animate({scrollTop: 0}, 250); + } + } + }) .append( pandora.$ui.sortElement = pandora.ui.sortElement() ) diff --git a/static/js/pandora/navigationView.js b/static/js/pandora/navigationView.js index 8dd2bdf6..c960071e 100644 --- a/static/js/pandora/navigationView.js +++ b/static/js/pandora/navigationView.js @@ -19,7 +19,14 @@ pandora.ui.navigationView = function(type, videoRatio) { $toolbar = Ox.Bar({size: 24}) .append( pandora.$ui.sortElement = pandora.ui.sortElement(true) - ), + ) + .bindEvent({ + doubleclick: function(e) { + if ($(e.target).is('.OxBar')) { + $list.animate({scrollTop: 0}, 250); + } + } + }), $list = pandora.ui.clipList(videoRatio) .bindEvent({ diff --git a/static/js/pandora/sectionbar.js b/static/js/pandora/sectionbar.js index 8809559d..5aaf34e5 100644 --- a/static/js/pandora/sectionbar.js +++ b/static/js/pandora/sectionbar.js @@ -8,10 +8,14 @@ pandora.ui.sectionbar = function(mode) { mode == 'buttons' ? pandora.$ui.sectionButtons = pandora.ui.sectionButtons() : pandora.$ui.sectionSelect = pandora.ui.sectionSelect() - ); - that.toggle = function() { - - }; + ) + .bindEvent({ + doubleclick: function(e) { + if ($(e.target).is('.OxBar')) { + pandora.$ui.folders.animate({scrollTop: 0}, 250); + } + } + }); return that; }; diff --git a/static/js/pandora/toolbar.js b/static/js/pandora/toolbar.js index 448b37ea..c2f5fee5 100644 --- a/static/js/pandora/toolbar.js +++ b/static/js/pandora/toolbar.js @@ -45,6 +45,15 @@ pandora.ui.toolbar = function() { }) .hide() ); + (!ui.item ? pandora.$ui.listTitle : pandora.$ui.itemTitle).bindEvent({ + doubleclick: function() { + if (!ui.item) { + pandora.$ui.list && pandora.$ui.list.animate({scrollTop: 0}, 250); + } else { + pandora.$ui.browser.scrollToSelection(); + } + } + }) that.append( pandora.$ui.findElement = pandora.ui.findElement() );