Changeset 2227 in subversion
- Timestamp:
- Jan 9, 2009 10:45:15 AM (4 years ago)
- File:
-
- 1 edited
-
branches/devel-api/skins/default/splitter.js (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-api/skins/default/splitter.js
r2169 r2227 23 23 24 24 // create and position the handle for this splitter 25 this.p1pos = rcube_get_object_pos(this.p1, this.relative);26 this.p2pos = rcube_get_object_pos(this.p2, this.relative);25 this.p1pos = this.relative ? $(this.p1).position() : $(this.p1).offset(); 26 this.p2pos = this.relative ? $(this.p2).position() : $(this.p2).offset(); 27 27 28 28 if (this.horizontal) 29 29 { 30 var top = this.p1pos. y+ this.p1.offsetHeight;30 var top = this.p1pos.top + this.p1.offsetHeight; 31 31 this.layer = new rcube_layer(this.id, {x: 0, y: top, height: 10, 32 32 width: '100%', vis: 1, parent: this.p1.parentNode}); … … 34 34 else 35 35 { 36 var left = this.p1pos. x+ this.p1.offsetWidth;36 var left = this.p1pos.left + this.p1.offsetWidth; 37 37 this.layer = new rcube_layer(this.id, {x: left, y: 0, width: 10, 38 38 height: '100%', vis: 1, parent: this.p1.parentNode}); … … 71 71 { 72 72 var lh = this.layer.height - this.offset * 2; 73 this.p1.style.height = Math.floor(this.pos - this.p1pos. y- lh / 2) + 'px';73 this.p1.style.height = Math.floor(this.pos - this.p1pos.top - lh / 2) + 'px'; 74 74 this.p2.style.top = Math.ceil(this.pos + lh / 2) + 'px'; 75 this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1)); 75 this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1)); 76 76 if (bw.ie) 77 {77 { 78 78 var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top)); 79 79 this.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; … … 82 82 else 83 83 { 84 this.p1.style.width = Math.floor(this.pos - this.p1pos. x- this.layer.width / 2) + 'px';84 this.p1.style.width = Math.floor(this.pos - this.p1pos.left - this.layer.width / 2) + 'px'; 85 85 this.p2.style.left = Math.ceil(this.pos + this.layer.width / 2) + 'px'; 86 86 this.layer.move(Math.round(this.pos - this.layer.width / 2 + 1), this.layer.y); … … 95 95 this.onDragStart = function(e) 96 96 { 97 this.p1pos = rcube_get_object_pos(this.p1, this.relative);98 this.p2pos = rcube_get_object_pos(this.p2, this.relative);97 this.p1pos = this.relative ? $(this.p1).position() : $(this.p1).offset(); 98 this.p2pos = this.relative ? $(this.p2).position() : $(this.p2).offset(); 99 99 this.drag_active = true; 100 100 … … 120 120 // the position of each iframe when the event is received 121 121 var s = this; 122 var id = iframes[n].id;123 this.iframe_events[n] = function(e){ e._offset = rcube_get_object_pos(document.getElementById(id)); return s.onDrag(e); }122 var id = '#'+iframes[n].id; 123 this.iframe_events[n] = function(e){ e._offset = $(id).offset(); return s.onDrag(e); } 124 124 125 125 if (iframedoc.addEventListener) … … 146 146 if (this.relative) 147 147 { 148 var parent = rcube_get_object_pos(this.p1.parentNode);149 pos.x -= parent. x;150 pos.y -= parent. y;151 } 152 153 if (this.horizontal) 154 { 155 if (((pos.y - this.layer.height * 1.5) > this.p1pos. y) && ((pos.y + this.layer.height * 1.5) < (this.p2pos.y+ this.p2.offsetHeight)))148 var parent = $(this.p1.parentNode).offset(); 149 pos.x -= parent.left; 150 pos.y -= parent.top; 151 } 152 153 if (this.horizontal) 154 { 155 if (((pos.y - this.layer.height * 1.5) > this.p1pos.top) && ((pos.y + this.layer.height * 1.5) < (this.p2pos.top + this.p2.offsetHeight))) 156 156 { 157 157 this.pos = pos.y; … … 161 161 else 162 162 { 163 if (((pos.x - this.layer.width * 1.5) > this.p1pos. x) && ((pos.x + this.layer.width * 1.5) < (this.p2pos.x+ this.p2.offsetWidth)))163 if (((pos.x - this.layer.width * 1.5) > this.p1pos.left) && ((pos.x + this.layer.width * 1.5) < (this.p2pos.left + this.p2.offsetWidth))) 164 164 { 165 165 this.pos = pos.x; … … 168 168 } 169 169 170 this.p1pos = rcube_get_object_pos(this.p1, this.relative);171 this.p2pos = rcube_get_object_pos(this.p2, this.relative);170 this.p1pos = this.relative ? $(this.p1).position() : $(this.p1).offset(); 171 this.p2pos = this.relative ? $(this.p2).position() : $(this.p2).offset(); 172 172 return false; 173 173 }; … … 199 199 if (iframedoc.removeEventListener) 200 200 iframedoc.removeEventListener('mousemove', this.iframe_events[n], false); 201 else if (iframedoc.detachEvent)201 else if (iframedoc.detachEvent) 202 202 iframedoc.detachEvent('onmousemove', this.iframe_events[n]); 203 203 else
Note: See TracChangeset
for help on using the changeset viewer.
