forked from 0x2620/pandora
fix issues with editable state of list icon in info panel (fixes #604)
This commit is contained in:
parent
a5c52f5019
commit
ef2b1403bb
2 changed files with 9 additions and 12 deletions
|
@ -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 = $('<div>').css({padding: '16px', textAlign: 'center'}),
|
||||
$icon = Ox.Element({
|
||||
element: '<img>',
|
||||
tooltip: editable ? 'Doubleclick to edit icon' : '',
|
||||
})
|
||||
$icon = Ox.Element('<img>')
|
||||
.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($('<div>').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,
|
||||
|
|
|
@ -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],
|
||||
|
||||
|
|
Loading…
Reference in a new issue