update pandora.getItemIdAndPosition

This commit is contained in:
rolux 2014-02-12 12:27:41 +00:00
parent ef9f23226f
commit 671ef01245

View file

@ -1245,28 +1245,34 @@ pandora.getItemIdAndPosition = function() {
position: ui.videoPoints[itemId] ? ui.videoPoints[itemId].position : 0 position: ui.videoPoints[itemId] ? ui.videoPoints[itemId].position : 0
}; };
} }
if (!ui.item) { if (ui.section == 'items') {
if ( if (!ui.item) {
ui.listView == 'timelines' if (
&& (selected = ui.listSelection).length == 1 ui.listView == 'timelines'
) { && (selected = ui.listSelection).length == 1
ret = getIdAndPositionByItemId(selected[0]); ) {
} else if ( ret = getIdAndPositionByItemId(selected[0]);
['clip', 'map', 'calendar'].indexOf(ui.listView) > -1 } else if (
&& pandora.$ui.clipList ['clip', 'map', 'calendar'].indexOf(ui.listView) > -1
&& (selected = pandora.$ui.clipList.options('selected')).length == 1 && pandora.$ui.clipList
) { && (selected = pandora.$ui.clipList.options('selected')).length == 1
ret = getIdAndPositionByClipId(selected[0]); ) {
ret = getIdAndPositionByClipId(selected[0]);
}
} else {
if (pandora.isVideoView()) {
ret = getIdAndPositionByItemId(ui.item);
} else if (
['clips', 'map', 'calendar'].indexOf(ui.itemView) > -1
&& pandora.$ui.clipList
&& (selected = pandora.$ui.clipList.options('selected')).length == 1
) {
ret = getIdAndPositionByClipId(selected[0]);
}
} }
} else { } else if (ui.section == 'edits') {
if (pandora.isVideoView()) { if (ui.edit) {
ret = getIdAndPositionByItemId(ui.item); // TODO
} else if (
['clips', 'map', 'calendar'].indexOf(ui.itemView) > -1
&& pandora.$ui.clipList
&& (selected = pandora.$ui.clipList.options('selected')).length == 1
) {
ret = getIdAndPositionByClipId(selected[0]);
} }
} }
return ret; return ret;