@@ -31,6 +31,8 @@ class ProgressBar extends React.Component {
3131 handleMouseMove ( e ) {
3232 e . preventDefault ( ) ;
3333 let chunkNum ;
34+
35+ // how far around mouse on X to look for viewable chunk
3436 let searchRadius = 10 ;
3537 let rect = this . inner . getBoundingClientRect ( ) ;
3638 let width = rect . right - rect . left ;
@@ -43,6 +45,7 @@ class ProgressBar extends React.Component {
4345 chunkNum = this . max - 1 ;
4446
4547 } else {
48+ // translate to viewable chunk array index
4649 x = Math . round ( ( x / width ) * this . max ) ;
4750 if ( x === this . current ) {
4851 return ;
@@ -70,6 +73,7 @@ class ProgressBar extends React.Component {
7073 }
7174 }
7275
76+ // move to chunk
7377 if ( this . viewable [ chunkNum ] ) {
7478 if ( chunkNum > this . current ) {
7579 this . next ( { stopAt : chunkNum , playing : false } ) ;
@@ -124,6 +128,7 @@ class ProgressBar extends React.Component {
124128 }
125129 }
126130
131+ // set the progress bar body
127132 const setProgress = ( ref , val ) => {
128133 setTransform ( ref , `scaleX(${ val } )` ) ;
129134 }
@@ -132,6 +137,7 @@ class ProgressBar extends React.Component {
132137 setTransform ( ref , `scaleX(${ val } )` ) ;
133138 }
134139
140+ // set the slider thumb position
135141 const setThumb = ( thumb , value ) => {
136142 if ( thumb !== null ) {
137143 const { style } = thumb ;
0 commit comments