forked from 0x2620/pandora
fix a bug that would lead to multiple views appearing on top of each other in the info panel
This commit is contained in:
parent
f75fc026ba
commit
4245a776ed
1 changed files with 30 additions and 27 deletions
|
@ -67,12 +67,14 @@ pandora.ui.info = function() {
|
|||
previousView = view;
|
||||
view = getView();
|
||||
if (view == 'list') {
|
||||
pandora.$ui.listInfo && pandora.$ui.listInfo.remove();
|
||||
that.empty().append(pandora.$ui.listInfo = pandora.ui.listInfo());
|
||||
previousView == 'video' && resizeInfo();
|
||||
} else if (view == 'poster') {
|
||||
pandora.api.get({id: id, keys: ['director', 'posterRatio', 'title']}, function(result) {
|
||||
var ratio = result.data.posterRatio,
|
||||
height = pandora.getInfoHeight(true);
|
||||
pandora.$ui.posterInfo && pandora.$ui.posterInfo.remove();
|
||||
that.empty().append(
|
||||
pandora.$ui.posterInfo = pandora.ui.posterInfo(Ox.extend(result.data, {id: id}))
|
||||
);
|
||||
|
@ -85,6 +87,7 @@ pandora.ui.info = function() {
|
|||
}, function(result) {
|
||||
if (result.data && result.data.rendered) {
|
||||
pandora.$ui.videoPreview && pandora.$ui.videoPreview.remove();
|
||||
that.empty().append(
|
||||
pandora.$ui.videoPreview = pandora.ui.videoPreview({
|
||||
duration: result.data.duration,
|
||||
frameRatio: result.data.videoRatio,
|
||||
|
@ -112,7 +115,7 @@ pandora.ui.info = function() {
|
|||
}
|
||||
}
|
||||
})
|
||||
.appendTo(pandora.$ui.info);
|
||||
);
|
||||
previousView != 'video' && resizeInfo();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue