fix ui bugs when editing the icon of an empty list (fixes #337)
This commit is contained in:
parent
a0b7ceadd3
commit
c552110125
1 changed files with 4 additions and 2 deletions
|
@ -325,6 +325,8 @@ pandora.ui.listIconPanel = function(listData) {
|
||||||
keys: ['posterFrames']
|
keys: ['posterFrames']
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
|
|
||||||
|
Ox.print('----/----', result.data)
|
||||||
|
|
||||||
var posterFrames = result.data.items[0].posterFrames,
|
var posterFrames = result.data.items[0].posterFrames,
|
||||||
posterFrame = posterFrames[quarter],
|
posterFrame = posterFrames[quarter],
|
||||||
|
|
||||||
|
@ -401,7 +403,7 @@ pandora.ui.listIconPanel = function(listData) {
|
||||||
} else {
|
} else {
|
||||||
itemData = $list.value(posterFrame.item);
|
itemData = $list.value(posterFrame.item);
|
||||||
}
|
}
|
||||||
renderPreview(itemData);
|
posterFrames.length && renderPreview(itemData);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.gainFocus();
|
.gainFocus();
|
||||||
|
@ -411,7 +413,7 @@ pandora.ui.listIconPanel = function(listData) {
|
||||||
function clickIcon(e, isDoubleClick) {
|
function clickIcon(e, isDoubleClick) {
|
||||||
quarter = quarters.indexOf($(e.target).attr('id'));
|
quarter = quarters.indexOf($(e.target).attr('id'));
|
||||||
renderQuarters();
|
renderQuarters();
|
||||||
if (isDoubleClick) {
|
if (isDoubleClick && posterFrames.length) {
|
||||||
var item = posterFrames[quarter].item;
|
var item = posterFrames[quarter].item;
|
||||||
$list.options({selected: [item]});
|
$list.options({selected: [item]});
|
||||||
renderPreview($list.value(item), posterFrames[quarter].position);
|
renderPreview($list.value(item), posterFrames[quarter].position);
|
||||||
|
|
Loading…
Reference in a new issue