make links work in info view

This commit is contained in:
rlx 2011-08-07 16:30:26 +00:00
parent 074aed8067
commit e1b07966be

View file

@ -51,8 +51,8 @@ pandora.ui.infoView = function(data) {
}) })
.appendTo($data.$element), .appendTo($data.$element),
$reflection = $('<div>') $reflection = $('<div>')
.addClass('OxReflection')
.css({ .css({
display: 'block',
position: 'absolute', position: 'absolute',
left: margin + 'px', left: margin + 'px',
top: margin + posterHeight + 'px', top: margin + posterHeight + 'px',
@ -69,20 +69,15 @@ pandora.ui.infoView = function(data) {
position: 'absolute', position: 'absolute',
left: posterLeft + 'px', left: posterLeft + 'px',
width: posterWidth + 'px', width: posterWidth + 'px',
height: posterHeight + 'px', height: posterHeight + 'px'
MozTransform: 'scaleY(-1)',
WebkitTransform: 'scaleY(-1)'
}) })
.appendTo($reflection), .appendTo($reflection),
$reflectionGradient = $('<div>') $reflectionGradient = $('<div>')
.css({ .css({
display: 'block',
position: 'absolute', position: 'absolute',
width: posterSize + 'px', width: posterSize + 'px',
height: posterSize / 2 + 'px' height: posterSize / 2 + 'px'
}) })
.css('background', '-moz-linear-gradient(top, rgba(16, 16, 16, 0.75), rgba(16, 16, 16, 1))')
.css('background', '-webkit-linear-gradient(top, rgba(16, 16, 16, 0.75), rgba(16, 16, 16, 1))')
.appendTo($reflection), .appendTo($reflection),
$text = $('<div>') $text = $('<div>')
.css({ .css({
@ -91,6 +86,15 @@ pandora.ui.infoView = function(data) {
top: margin + 'px', top: margin + 'px',
right: margin + 'px' right: margin + 'px'
}) })
.bind({
click: function(e) {
var $target = $(e.target);
if ($target.is('.OxLink')) {
Ox.print('LINK', $target.data('link'));
pandora.URL.set($target.data('link'));
}
}
})
.appendTo($data.$element), .appendTo($data.$element),
$browserImages = []; $browserImages = [];
@ -426,7 +430,10 @@ pandora.ui.infoView = function(data) {
function formatValue(value, key) { function formatValue(value, key) {
return (Ox.isArray(value) ? value : [value]).map(function(value) { return (Ox.isArray(value) ? value : [value]).map(function(value) {
return key ? '<a href="/?find=' + key + ':' + value + '">' + value + '</a>' : value; return key ?
'<span class="OxLink" data-link="?find=' + key + ':' + value + '">' + value + '</span>'
: value;
//return key ? '<a href="/?find=' + key + ':' + value + '">' + value + '</a>' : value;
}).join(', '); }).join(', ');
} }