Changeset 05b9a2a in github


Ignore:
Timestamp:
Dec 17, 2008 6:19:24 AM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
44ea3fd
Parents:
c2af7eb
Message:

#1485631: code clean up, small fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skins/default/splitter.js

    r80c6786 r05b9a2a  
    7575      this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1));       
    7676      if (bw.ie) 
    77         this.p2.style.height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top))+'px'; 
     77        { 
     78        var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top)); 
     79        this.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; 
     80        } 
    7881      } 
    7982    else 
     
    118121        var s = this; 
    119122        var id = iframes[n].id; 
    120         this.iframe_events[n] = function(e){ e._rc_pos_offset = rcube_get_object_pos(document.getElementById(id)); return s.onDrag(e); } 
     123        this.iframe_events[n] = function(e){ e._offset = rcube_get_object_pos(document.getElementById(id)); return s.onDrag(e); } 
    121124 
    122125        if (iframedoc.addEventListener) 
     
    137140  this.onDrag = function(e) 
    138141    { 
     142    if (!this.drag_active) return false; 
     143 
    139144    var pos = rcube_event.get_mouse_pos(e); 
    140  
    141     if (!this.drag_active) return false; 
    142  
    143     if (e._rc_pos_offset) 
    144       { 
    145       pos.x += e._rc_pos_offset.x; 
    146       pos.y += e._rc_pos_offset.y; 
    147       } 
    148145 
    149146    if (this.relative) 
     
    216213    return bw.safari ? true : rcube_event.cancel(e); 
    217214    }; 
     215 
    218216  /** 
    219217   * Handler for window resize events 
     
    222220    { 
    223221    if (this.horizontal) 
    224       this.p2.style.height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top))+'px'; 
     222      { 
     223      var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top)); 
     224      this.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; 
     225      } 
    225226    else 
    226227      this.p2.style.width = (parseInt(this.p2.parentNode.offsetWidth) - parseInt(this.p2.style.left))+'px'; 
Note: See TracChangeset for help on using the changeset viewer.