diff --git a/static/js/pandora/UI.js b/static/js/pandora/UI.js index 1727e5763..215bfea26 100644 --- a/static/js/pandora/UI.js +++ b/static/js/pandora/UI.js @@ -118,6 +118,7 @@ pandora.UI = (function() { } */ // pandora.URL.update(Object.keys(trigger)); + Ox.print('isBooting?', !pandora.$ui.appPanel, Object.keys(args)); pandora.URL.update(Object.keys( !pandora.$ui.appPanel ? args : trigger )); diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 07a569d79..57ab2c641 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -332,7 +332,8 @@ pandora.URL = (function() { if (url) { self.URL.push(null, '', url, setState); } else { - alert('DO YOU REALLY WANT TO CALL PUSH WITHOUT URL?') + // fixme + //alert('DO YOU REALLY WANT TO CALL PUSH WITHOUT URL?') //self.URL.push(getState()); } return that; @@ -349,6 +350,7 @@ pandora.URL = (function() { }; that.update = function(keys) { + Ox.print('update.........', keys) // this gets called from pandora.UI var action; if (self.isPopState) { diff --git a/static/js/pandora/ui/clipList.js b/static/js/pandora/ui/clipList.js index 7cb71f482..41c1bb56f 100644 --- a/static/js/pandora/ui/clipList.js +++ b/static/js/pandora/ui/clipList.js @@ -5,6 +5,7 @@ pandora.ui.clipList = function(videoRatio) { var ui = pandora.user.ui, fixedRatio = !ui.item ? 16/9 : videoRatio, isClipView = !ui.item ? ui.listView == 'clip' : ui.itemView == 'clips', + $selectedVideo, that = Ox.IconList({ fixedRatio: fixedRatio, @@ -47,14 +48,9 @@ pandora.ui.clipList = function(videoRatio) { query = {conditions: [], operator: '&'}; // if the item query contains a layer condition, // then this condition is added to the clip query - // fixme: don't just check for 'subtitles' itemQuery.conditions.forEach(function(condition) { - if (condition.key == 'subtitles') { - query.conditions.push({ - key: 'value', - value: condition.value, - operator: condition.operator - }); + if (Ox.getPositionById(pandora.site.layers, condition.key) > -1) { + query.conditions.push(condition); } }); } else { @@ -158,6 +154,7 @@ pandora.ui.clipList = function(videoRatio) { $img.replaceWith($player.$element); $('.OxSelectedVideo').removeClass('OxSelectedVideo'); $player.$element.addClass('OxSelectedVideo'); + $selectedVideo = $player; }); } else if ($video.length) { // item select fires before video click @@ -167,11 +164,15 @@ pandora.ui.clipList = function(videoRatio) { setTimeout(function() { $('.OxSelectedVideo').removeClass('OxSelectedVideo'); $video.addClass('OxSelectedVideo'); + $selectedVideo = $video; }, 300); } !ui.item && pandora.UI.set('listSelection', [item]); } else { $('.OxSelectedVideo').removeClass('OxSelectedVideo'); + $selectedVideo && $selectedVideo.options({ + position: $selectedVideo.options('in') + }); !ui.item && pandora.UI.set('listSelection', []); } } diff --git a/static/js/pandora/ui/folderBrowserBar.js b/static/js/pandora/ui/folderBrowserBar.js index 7ff171d9d..6cbf08c7d 100644 --- a/static/js/pandora/ui/folderBrowserBar.js +++ b/static/js/pandora/ui/folderBrowserBar.js @@ -17,7 +17,7 @@ pandora.ui.folderBrowserBar = function(id) { change: function(data) { var key = data.selected[0].id == 'user' ? 'user' : 'name', value = pandora.$ui.findListInput[id].value(); - value && updateItems(key, value); + value && updateList(key, value); pandora.$ui.findListInput[id].options({ placeholder: data.selected[0].title }); @@ -33,7 +33,7 @@ pandora.ui.folderBrowserBar = function(id) { change: function(data) { var key = pandora.$ui.findListSelect[id].value() == 'user' ? 'user' : 'name', value = data.value; - updateItems(key, value); + updateList(key, value); } }) ], @@ -44,7 +44,7 @@ pandora.ui.folderBrowserBar = function(id) { align: 'right' }) .appendTo(that); - function updateItems(key, value) { + function updateList(key, value) { pandora.$ui.folderList[id].options({ items: function(data, callback) { var query = id == 'favorite' ? {conditions: [ diff --git a/static/js/pandora/ui/usersDialog.js b/static/js/pandora/ui/usersDialog.js index 4131dbeff..170f6d51a 100644 --- a/static/js/pandora/ui/usersDialog.js +++ b/static/js/pandora/ui/usersDialog.js @@ -68,7 +68,7 @@ pandora.ui.usersDialog = function() { change: function(data) { var key = data.selected[0].id, value = $findInput.value(); - value && updateItems(key, value); + value && updateList(key, value); $findInput.options({ placeholder: data.selected[0].title }); @@ -85,7 +85,7 @@ pandora.ui.usersDialog = function() { change: function(data) { var key = $findSelect.value(), value = data.value; - updateItems(key, value); + updateList(key, value); } }), @@ -396,7 +396,7 @@ pandora.ui.usersDialog = function() { } - function updateItems(key, value) { + function updateList(key, value) { var query = { conditions: Ox.merge( key != 'email' ? [{key: 'username', value: value, operator: '='}] : [], @@ -410,8 +410,7 @@ pandora.ui.usersDialog = function() { query: query }), callback); } - }); - + }); } return that;