only listen to main videopoints.id event

This commit is contained in:
j 2012-07-01 11:40:54 +00:00
parent a1163b5f2e
commit dcaa9d0817

View file

@ -7,7 +7,8 @@ pandora.ui.item = function() {
'timeline', 'player', 'editor'
].indexOf(pandora.user.ui.itemView) > -1,
item = pandora.user.ui.item,
that = Ox.Element();
that = Ox.Element(),
videopointsEvent = 'pandora_videopoints.' + item.toLowerCase();
pandora.api.get({
id: pandora.user.ui.item,
@ -135,11 +136,12 @@ pandora.ui.item = function() {
if (isVideoView && result.data.rendered) {
// handle links in annotations
pandora.$ui[pandora.user.ui.itemView].bindEvent(
'pandora_videopoints.' + pandora.user.ui.item.toLowerCase(),
function(data) {
//Ox.print('DATA.VALUE', JSON.stringify(data.value));
videopointsEvent,
function(data, event, element) {
var options = {};
if (data.value.annotation) {
if (event == videopointsEvent) {
//Ox.print('DATA.VALUE', JSON.stringify(data.value));
if (data && data.value && data.value.annotation) {
options.selected = pandora.user.ui.item + '/' + data.value.annotation;
} else {
// if annotation got set to something other than '',
@ -153,6 +155,7 @@ pandora.ui.item = function() {
}
pandora.$ui[pandora.user.ui.itemView].options(options);
}
}
);
}