| | |
| | | this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1)); |
| | | if (bw.ie) |
| | | { |
| | | var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top)); |
| | | var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top) - (bw.ie8 ? 2 : 0)); |
| | | this.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; |
| | | } |
| | | } |
| | |
| | | */ |
| | | this.onDragStart = function(e) |
| | | { |
| | | // disable text selection while dragging the splitter |
| | | if (window.webkit || bw.safari) |
| | | document.body.style.webkitUserSelect = 'none'; |
| | | |
| | | this.p1pos = this.relative ? $(this.p1).position() : $(this.p1).offset(); |
| | | this.p2pos = this.relative ? $(this.p2).position() : $(this.p2).offset(); |
| | | this.drag_active = true; |
| | | |
| | | |
| | | // start listening to mousemove events |
| | | rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'onDrag'}); |
| | | rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'onDragStop'}); |
| | |
| | | */ |
| | | this.onDragStop = function(e) |
| | | { |
| | | // resume the ability to highlight text |
| | | if(window.webkit || bw.safari) |
| | | document.body.style.webkitUserSelect = 'auto'; |
| | | |
| | | // cancel the listening for drag events |
| | | rcube_event.remove_listener({element:document, event:'mousemove', object:this, method:'onDrag'}); |
| | | rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'onDragStop'}); |
| | |
| | | { |
| | | if (this.horizontal) |
| | | { |
| | | var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top)); |
| | | var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top) - (bw.ie8 ? 2 : 0)); |
| | | this.p2.style.height = (new_height > 0 ? new_height : 0) +'px'; |
| | | } |
| | | else |