src/js/widgets/arrowWidget.js
branchpopcorn-port
changeset 337 ee1d1e4fcf45
parent 321 21d840371c6b
child 535 7c25af985344
equal deleted inserted replaced
336:8da13562cfea 337:ee1d1e4fcf45
    38     // it's half the length of the arrow (27 / 2). We need to convert
    38     // it's half the length of the arrow (27 / 2). We need to convert
    39     // it in percents though.
    39     // it in percents though.
    40     var totalWidth = this.selector.width();
    40     var totalWidth = this.selector.width();
    41     var correction = ((27 / 2) / totalWidth) * 100;
    41     var correction = ((27 / 2) / totalWidth) * 100;
    42     var corrected_percents = percents - correction;
    42     var corrected_percents = percents - correction;
       
    43 
       
    44     /* don't move out of the screen */
       
    45     if (corrected_percents <= 0)
       
    46       corrected_percents = 0;
       
    47 
    43     this.selector.children(".Ldt-arrowWidget").animate({"left" : corrected_percents + "%"});
    48     this.selector.children(".Ldt-arrowWidget").animate({"left" : corrected_percents + "%"});
    44 
    49 
    45     this._oldAnnotation = currentAnnotation;
    50     this._oldAnnotation = currentAnnotation;
    46   }
    51   }
    47 }
    52 }