From c3e06cc86977f24e9c1bdde2c121e0ccd1f6540c Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 3 Mar 2013 07:23:04 +0000 Subject: [PATCH] update all items element and folder lists --- static/js/pandora/allItems.js | 23 ++++++++++++++++++----- static/js/pandora/folderBrowserList.js | 2 +- static/js/pandora/folderList.js | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/static/js/pandora/allItems.js b/static/js/pandora/allItems.js index 59307dc43..2ba11e013 100644 --- a/static/js/pandora/allItems.js +++ b/static/js/pandora/allItems.js @@ -22,9 +22,9 @@ pandora.ui.allItems = function() { } }) .bindEvent({ - pandora_find: function() { - that[pandora.user.ui._list ? 'removeClass' : 'addClass']('OxSelected'); - } + pandora_find: updateSelected, + pandora_section: updateSelected, + pandora_text: updateSelected }), $icon = $('') .attr({src: '/static/png/icon.png'}) @@ -92,7 +92,6 @@ pandora.ui.allItems = function() { tooltip: 'HTML', type: 'image' }) - .css({opacity: 0.25}) .appendTo(that); Ox.Button({ style: 'symbol', @@ -100,10 +99,24 @@ pandora.ui.allItems = function() { tooltip: 'Help', type: 'image' }) - .css({opacity: 0.25}) + .bindEvent({ + click: function() { + pandora.UI.set({page: 'help'}); + } + }) .appendTo(that); } + updateSelected(); + + function updateSelected() { + that[ + (pandora.user.ui.section == 'items' && pandora.user.ui._list) + || (pandora.user.ui.section == 'texts' && pandora.user.ui.text) + ? 'removeClass' : 'addClass' + ]('OxSelected'); + } + that.update = function(items) { $items && $items.html(Ox.formatNumber(items)); }; diff --git a/static/js/pandora/folderBrowserList.js b/static/js/pandora/folderBrowserList.js index 69b466a97..bbe578171 100644 --- a/static/js/pandora/folderBrowserList.js +++ b/static/js/pandora/folderBrowserList.js @@ -88,7 +88,7 @@ pandora.ui.folderBrowserList = function(id) { width: '10px', height: '10px', padding: '3px', - opacity: ui.section == 'items' && data.user == pandora.user.username ? 1 : 0.25 + opacity: ui.section == 'texts' || data.user == pandora.user.username ? 1 : 0.25 }); }, id: 'type', diff --git a/static/js/pandora/folderList.js b/static/js/pandora/folderList.js index 3a1d21b63..e0e828ce2 100644 --- a/static/js/pandora/folderList.js +++ b/static/js/pandora/folderList.js @@ -94,7 +94,7 @@ pandora.ui.folderList = function(id) { width: '10px', height: '10px', padding: '3px', - opacity: ui.section == 'items' && data.user == pandora.user.username ? 1 : 0.25 + opacity: ui.section == 'texts' || data.user == pandora.user.username ? 1 : 0.25 }); }, id: 'type',