integration/js/tangle.js
changeset 101 e40637c085b0
parent 74 22aca5b735a2
--- a/integration/js/tangle.js	Fri Jun 07 12:41:45 2013 +0200
+++ b/integration/js/tangle.js	Fri Jun 07 16:31:42 2013 +0200
@@ -45,6 +45,7 @@
         });
 
         row.find('.begin').text(chapterData.begin);
+        console.log(chapterData.getDuration())
         row.find('.duration').text(chapterData.getDuration());
         row.find('.end').text(chapterData.end);
 
@@ -58,7 +59,8 @@
     }
 
     function updateChapterDuration(val, chapterBefore, chapterAfter){
-        if (val<=chapterAfter.end && val>=chapterBefore.begin) {
+
+        if (val<=chapterAfter.end && val>=chapterBefore.begin && chapterAfter.end-val>secMiniChapter*1000 && val-chapterBefore.begin>secMiniChapter*1000) {
             chapterAfter.setBegin(val);
             chapterBefore.setEnd(val);
 
@@ -83,8 +85,10 @@
         
         var chapterAfter = chapters[indexChapter+1],
             chapterBefore = currentChapter;
+
+            updateChapterDuration(val, chapterBefore, chapterAfter);
+
         
-        updateChapterDuration(val, chapterBefore, chapterAfter);
     });
     /*
     $(".tangle-start")