From ef2b1403bba597d2b5ae93a9b645abaf40d60ebd Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 7 Mar 2012 14:06:55 +0000 Subject: [PATCH] fix issues with editable state of list icon in info panel (fixes #604) --- static/js/pandora/info.js | 19 +++++++++---------- static/js/pandora/listDialog.js | 2 -- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/static/js/pandora/info.js b/static/js/pandora/info.js index cd6bf6508..47933da97 100644 --- a/static/js/pandora/info.js +++ b/static/js/pandora/info.js @@ -138,12 +138,8 @@ pandora.ui.listInfo = function() { var list = pandora.user.ui._list, canEditFeaturedLists = pandora.site.capabilities.canEditFeaturedLists[pandora.user.level], - editable = list.split(':')[0] == pandora.user.username || canEditFeaturedLists, that = $('
').css({padding: '16px', textAlign: 'center'}), - $icon = Ox.Element({ - element: '', - tooltip: editable ? 'Doubleclick to edit icon' : '', - }) + $icon = Ox.Element('') .attr({ src: list ? '/list/' + list + '/icon256.jpg?' + Ox.uid() @@ -153,10 +149,6 @@ pandora.ui.listInfo = function() { .appendTo(that), $title, $description; - editable && $icon.bindEvent({ - doubleclick: editIcon - }); - that.append($('
').css({height: '16px'})); //fixme: allow editing @@ -170,7 +162,14 @@ pandora.ui.listInfo = function() { if (result.data.items.length) { var item = result.data.items[0], editable = item.user == pandora.user.username - || (item.status == 'featured' && canEditFeaturedLists); + || (item.status == 'featured' && canEditFeaturedLists); + if (editable) { + $icon.options({ + tooltip: 'Doubleclick to edit icon' + }).bindEvent({ + doubleclick: editIcon + }); + } that.append( $title = Ox.Editable({ editable: editable, diff --git a/static/js/pandora/listDialog.js b/static/js/pandora/listDialog.js index f268e1720..466ce1f3b 100644 --- a/static/js/pandora/listDialog.js +++ b/static/js/pandora/listDialog.js @@ -326,8 +326,6 @@ pandora.ui.listIconPanel = function(listData) { keys: ['posterFrames'] }, function(result) { - Ox.print('----/----', result.data) - var posterFrames = result.data.items[0].posterFrames, posterFrame = posterFrames[quarter],