From 37ee7a12672cf7cf4ca3f178eced3d7a45c21205 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 10 Oct 2012 08:15:30 +0000 Subject: [PATCH] 0xdb info view: make 'reload metadata' a button --- static/js/pandora/infoView.0xdb.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/static/js/pandora/infoView.0xdb.js b/static/js/pandora/infoView.0xdb.js index 8c7006945..6c9df9bc6 100644 --- a/static/js/pandora/infoView.0xdb.js +++ b/static/js/pandora/infoView.0xdb.js @@ -114,18 +114,13 @@ pandora.ui.infoView = function(data) { }) .appendTo($reflection), - $text = Ox.Element({ - tooltip: canEdit && !isEditable ? 'Doubleclick to reload metadata' : '' - }) + $text = Ox.Element() .css({ position: 'absolute', left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px', top: margin + 'px', right: margin + statisticsWidth + margin + 'px' }) - .bindEvent(canEdit && !isEditable ? { - doubleclick: reloadMetadata - } : {}) .appendTo($data.$element), $statistics = $('
') @@ -137,6 +132,8 @@ pandora.ui.infoView = function(data) { }) .appendTo($data.$element), + $reloadButton, + $capabilities, $browserImages = []; @@ -454,6 +451,18 @@ pandora.ui.infoView = function(data) { $('
').css({height: '16px'}).appendTo($text); + if (canEdit && !isEditable) { + $reloadButton = Ox.Button({ + title: 'Reload Metadata', + width: 128 + }) + .css({marginBottom: '4px'}) + .bindEvent({ + click: reloadMetadata + }) + .appendTo($statistics); + } + // Mainstream Score, Arthouse Score ---------------------------------------- ['votes', 'likes'].forEach(function(key) { @@ -629,6 +638,7 @@ pandora.ui.infoView = function(data) { function reloadMetadata() { var item = ui.item; // fixme: maybe there's a better method name for this? + $reloadButton.options({disabled: true, title: 'Reloading Metadata'}); pandora.api.updateExternalData({ id: ui.item }, function(result) {