scripts/position.js
changeset 78 08f8a72b1f7b
parent 42 774751e7faed
equal deleted inserted replaced
77:e5f1f45ea7e2 78:08f8a72b1f7b
    39 }
    39 }
    40 
    40 
    41 var posslide_handle_dragend = function(x, y)
    41 var posslide_handle_dragend = function(x, y)
    42 {
    42 {
    43   pos_in_drag = false;
    43   pos_in_drag = false;
       
    44   if ( !verify_online() )
       
    45   {
       
    46     posslide_set_position(current_track_pos);
       
    47     return false;
       
    48   }
       
    49   
    44   var inner = document.getElementById('playhead-filler');
    50   var inner = document.getElementById('playhead-filler');
    45   var base = document.getElementById('playhead');
    51   var base = document.getElementById('playhead');
    46   var multiplier = $(base).Width() - 13;
    52   var multiplier = $(base).Width() - 13;
    47   var pos = x - $(inner).Left() + 8;
    53   var pos = x - $(inner).Left() + 8;
    48   pos = 100 * ( pos / multiplier );
    54   pos = 100 * ( pos / multiplier );
    49   set_playback_position(pos);
    55   set_playback_position(pos);
    50 }
    56 }
    51 
    57 
    52 var posslide_handle_click = function(e)
    58 var posslide_handle_click = function(e)
    53 {
    59 {
       
    60   if ( !verify_online() )
       
    61     return false;
       
    62   
    54   e = Drag.fixE(e);
    63   e = Drag.fixE(e);
    55   var base = document.getElementById('playhead');
    64   var base = document.getElementById('playhead');
    56   var val = e.clientX - $(base).Left();
    65   var val = e.clientX - $(base).Left();
    57   val = 100 * ( val / $(base).Width() );
    66   val = 100 * ( val / $(base).Width() );
    58   posslide_set_position(val);
    67   posslide_set_position(val);