From 1e3fa3c98e88a9ebce60f3dcb7b443726d2ad8dd Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 15 Nov 2014 14:13:42 +0000 Subject: [PATCH] fix #2559 (extra history entry added when resolving annotation id breaks back button) --- static/js/utils.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/static/js/utils.js b/static/js/utils.js index 1f079ca3e..8665720a0 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1686,12 +1686,15 @@ pandora.getSpan = function(state, val, callback) { if (result.data.items.length) { span = result.data.items[0]; annotation = span.id.split('/')[1]; - type == 'annotation' && pandora.UI.set('videoPoints.' + state.item, { - annotation: annotation, - 'in': span['in'], - out: span.out, - position: span['in'] - }); + // This is an optimization to make sure the video view + // immediately loads at the correct position + if (type == 'annotation') { + pandora.user.ui.videoPoints[state.item] = { + 'in': span['in'], + out: span.out, + position: span['in'] + }; + } } callback( !span ? ''