From c5521101259dedd27cb25a3c94eafd95089c8177 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 7 Mar 2012 12:54:19 +0000 Subject: [PATCH] fix ui bugs when editing the icon of an empty list (fixes #337) --- static/js/pandora/listDialog.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/listDialog.js b/static/js/pandora/listDialog.js index 9fa183534..2cd327ed6 100644 --- a/static/js/pandora/listDialog.js +++ b/static/js/pandora/listDialog.js @@ -325,6 +325,8 @@ pandora.ui.listIconPanel = function(listData) { keys: ['posterFrames'] }, function(result) { + Ox.print('----/----', result.data) + var posterFrames = result.data.items[0].posterFrames, posterFrame = posterFrames[quarter], @@ -401,7 +403,7 @@ pandora.ui.listIconPanel = function(listData) { } else { itemData = $list.value(posterFrame.item); } - renderPreview(itemData); + posterFrames.length && renderPreview(itemData); } }) .gainFocus(); @@ -411,7 +413,7 @@ pandora.ui.listIconPanel = function(listData) { function clickIcon(e, isDoubleClick) { quarter = quarters.indexOf($(e.target).attr('id')); renderQuarters(); - if (isDoubleClick) { + if (isDoubleClick && posterFrames.length) { var item = posterFrames[quarter].item; $list.options({selected: [item]}); renderPreview($list.value(item), posterFrames[quarter].position);