From 5f69fd35dfe8ee564f6a5cd2faea9117aed19e43 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 23 Sep 2014 12:13:10 +0200 Subject: [PATCH] faster timeline markers --- source/Ox.UI/js/Video/LargeVideoTimeline.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/Ox.UI/js/Video/LargeVideoTimeline.js b/source/Ox.UI/js/Video/LargeVideoTimeline.js index 7b9cedb2..3170cb00 100644 --- a/source/Ox.UI/js/Video/LargeVideoTimeline.js +++ b/source/Ox.UI/js/Video/LargeVideoTimeline.js @@ -97,17 +97,20 @@ Ox.LargeVideoTimeline = function(options, self) { setTimeout(function() { var chapters = self.options.chapters.slice(1).map(function(chapter) { - return chapter.position; - }); + return chapter.position; + }), + $cut =$('') + .addClass('OxCut') + .attr({src: Ox.UI.getImageURL('markerCut')}), + $chapter =$('') + .addClass('OxChapter') + .attr({src: Ox.UI.getImageURL('markerChapter')}); Ox.unique(chapters.concat(self.options.cuts)).forEach(function(v, i) { - self.$cuts[i] = $('') - .addClass(Ox.contains(chapters, v) ? 'OxChapter' : 'OxCut') + self.$cuts[i] = (Ox.contains(chapters, v) ? $chapter : $cut) + .clone() .css({left: (v * self.fps) + 'px'}) .appendTo(self.$timeline); }); - // performs better - self.$timeline.find('.OxChapter').attr({src: Ox.UI.getImageURL('markerChapter')}); - self.$timeline.find('.OxCut').attr({src: Ox.UI.getImageURL('markerCut')}); }); self.$markerPosition = $('')