move reloadMetadata from doubleclick on title or director to doubleclick on metadata

This commit is contained in:
rolux 2011-10-30 15:22:45 +00:00
parent 7edf7ac0db
commit c0e6e012b2

View file

@ -106,7 +106,9 @@ pandora.ui.infoView = function(data) {
}) })
.appendTo($reflection), .appendTo($reflection),
$text = Ox.Element() $text = Ox.Element({
tooltip: canEdit && !isEditable ? 'Doubleclick to reload metadata' : ''
})
.css({ .css({
position: 'absolute', position: 'absolute',
left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px', left: margin + (iconSize == 256 ? 256 : iconWidth) + margin + 'px',
@ -114,6 +116,9 @@ pandora.ui.infoView = function(data) {
right: margin + statisticsWidth + margin + 'px', right: margin + statisticsWidth + margin + 'px',
//background: 'green' //background: 'green'
}) })
.bindEvent(canEdit && !isEditable ? {
doubleclick: reloadMetadata
} : {})
.appendTo($data.$element), .appendTo($data.$element),
$statistics = $('<div>') $statistics = $('<div>')
@ -141,8 +146,7 @@ pandora.ui.infoView = function(data) {
format: function(value) { format: function(value) {
return formatTitle(value); return formatTitle(value);
}, },
tooltip: isEditable ? 'Doubleclick to edit' tooltip: isEditable ? 'Doubleclick to edit' : '',
: canEdit ? 'Doubleclick to reload metadata' : '',
value: data.title value: data.title
}) })
.css({ .css({
@ -152,13 +156,11 @@ pandora.ui.infoView = function(data) {
MozUserSelect: 'text', MozUserSelect: 'text',
WebkitUserSelect: 'text' WebkitUserSelect: 'text'
}) })
.bindEvent(Ox.extend({ .bindEvent({
submit: function(event) { submit: function(event) {
editMetadata('title', event.value); editMetadata('title', event.value);
} }
}, !isEditable && canEdit ? { })
doubleclick: reloadMetadata
} : {}))
.appendTo($text) .appendTo($text)
) )
.appendTo($text); .appendTo($text);
@ -179,8 +181,7 @@ pandora.ui.infoView = function(data) {
? formatValue(value.split(', '), 'name') ? formatValue(value.split(', '), 'name')
: formatLight('Unknown Director'); : formatLight('Unknown Director');
}, },
tooltip: isEditable ? 'Doubleclick to edit' tooltip: isEditable ? 'Doubleclick to edit' : '',
: canEdit ? 'Doubleclick to reload metadata' : '',
value: data.director ? data.director.join(', ') : 'Unknown Director' value: data.director ? data.director.join(', ') : 'Unknown Director'
}) })
.css({ .css({
@ -190,13 +191,11 @@ pandora.ui.infoView = function(data) {
MozUserSelect: 'text', MozUserSelect: 'text',
WebkitUserSelect: 'text' WebkitUserSelect: 'text'
}) })
.bindEvent(Ox.extend({ .bindEvent({
submit: function(event) { submit: function(event) {
editMetadata('director', event.value); editMetadata('director', event.value);
} }
}, !isEditable && canEdit ? { })
doubleclick: reloadMetadata
} : {}))
) )
.appendTo($text); .appendTo($text);
} }