clr commited on
Commit
338bf4e
1 Parent(s): c2b7a37

Update js/js.php

Browse files
Files changed (1) hide show
  1. js/js.php +4 -3
js/js.php CHANGED
@@ -102,6 +102,7 @@ function isPlaying($ref) {
102
  }
103
 
104
 
 
105
  // Returns true if $elem is beyond the current scrolled view.
106
  function isScrolledOutOfView($elem) {
107
  var $window = $(window);
@@ -113,7 +114,7 @@ function isScrolledOutOfView($elem) {
113
  var elemBottom = elemTop + $elem.height();
114
 
115
  return ((elemBottom > windowBottom) || (elemTop < windowTop));
116
- }
117
 
118
  // Callback function for timeupdate event.
119
  function updatePosition( currentTime ) {
@@ -124,12 +125,12 @@ function updatePosition( currentTime ) {
124
  notPlaying($( 'span[name=utterance]' )); // Mark everything as "not playing".
125
  isPlaying($( '#' + intervals[c].begin )); // Mark line corresponding to currentTime as "playing".
126
 
127
- // Auto-scroll if playing line is out of view.
128
  if (isScrolledOutOfView($('.playing'))) {
129
  $('html, body').animate({
130
  scrollTop: ($(".playing").offset().top - ($(window).height() / 2))
131
  }, 500);
132
- }
133
  }
134
  //$( 'span[name=utterance]' ).removeClass('uttPlaying'); // No interval defined at currentTime.
135
  }
 
102
  }
103
 
104
 
105
+ /*
106
  // Returns true if $elem is beyond the current scrolled view.
107
  function isScrolledOutOfView($elem) {
108
  var $window = $(window);
 
114
  var elemBottom = elemTop + $elem.height();
115
 
116
  return ((elemBottom > windowBottom) || (elemTop < windowTop));
117
+ } */
118
 
119
  // Callback function for timeupdate event.
120
  function updatePosition( currentTime ) {
 
125
  notPlaying($( 'span[name=utterance]' )); // Mark everything as "not playing".
126
  isPlaying($( '#' + intervals[c].begin )); // Mark line corresponding to currentTime as "playing".
127
 
128
+ /* // Auto-scroll if playing line is out of view.
129
  if (isScrolledOutOfView($('.playing'))) {
130
  $('html, body').animate({
131
  scrollTop: ($(".playing").offset().top - ($(window).height() / 2))
132
  }, 500);
133
+ } */
134
  }
135
  //$( 'span[name=utterance]' ).removeClass('uttPlaying'); // No interval defined at currentTime.
136
  }