forked from 0x2620/pandora
improving info view
This commit is contained in:
parent
3a93f972df
commit
af1f7a28c9
2 changed files with 34 additions and 25 deletions
|
|
@ -105,9 +105,12 @@ pandora.ui.item = function() {
|
|||
} else {
|
||||
$.get('/static/html/itemInfo.html', {}, function(template) {
|
||||
//Ox.print(template);
|
||||
var posterRatio = result.data.poster.width / result.data.poster.height;
|
||||
result.data.posterWidth = posterRatio > 1 ? 256 : Math.round(256 * posterRatio);
|
||||
result.data.posterHeight = posterRatio < 1 ? 256 : Math.round(256 / posterRatio);
|
||||
result.data.posterLeft = Math.floor((256 - result.data.posterWidth) / 2);
|
||||
pandora.$ui.contentPanel.replaceElement(1,
|
||||
pandora.$ui.item = Ox.Element()
|
||||
.append($.tmpl(template, result.data))
|
||||
pandora.$ui.item = Ox.Element().append($.tmpl(template, result.data))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue