From 42894917fa14be8002a41e3be2938191e351698d Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 11 Feb 2013 13:34:55 +0530 Subject: [PATCH] make context browser react to listsort event --- static/js/pandora/browser.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/browser.js b/static/js/pandora/browser.js index e488599d3..a53292b09 100644 --- a/static/js/pandora/browser.js +++ b/static/js/pandora/browser.js @@ -115,8 +115,7 @@ pandora.ui.browser = function() { pageLength: 32, selected: [pandora.user.ui.item], size: 64, - sort: ['text', 'position'].indexOf(pandora.user.ui.listSort[0].key) > -1 - ? pandora.site.user.ui.listSort: pandora.user.ui.listSort, + sort: getSort(), unique: 'id' }) .addClass('OxMedia') @@ -162,6 +161,9 @@ pandora.ui.browser = function() { pandora_item: function(data) { that.options({selected: [data.value]}); }, + pandora_listsort: function() { + that.options({sort: getSort()}) + }, pandora_showsiteposters: function() { pandora.user.ui.icons == 'posters' && that.reloadList(true); } @@ -181,6 +183,10 @@ pandora.ui.browser = function() { that.css({overflowY: 'hidden'}); // this fixes a bug in firefox pandora.enableDragAndDrop(that, false); } + function getSort() { + return ['text', 'position'].indexOf(pandora.user.ui.listSort[0].key) > -1 + ? pandora.site.user.ui.listSort: pandora.user.ui.listSort + } return that; };