Make splitters more responsive (using timing events)
| | |
| | | if (!this.drag_active) |
| | | return false; |
| | | |
| | | ref = this; |
| | | |
| | | // with timing events dragging action is more responsive |
| | | window.clearTimeout(this.ts); |
| | | this.ts = window.setTimeout(function() { ref.onDragAction(e); }, 1); |
| | | |
| | | return false; |
| | | }; |
| | | |
| | | this.onDragAction = function(e) |
| | | { |
| | | var pos = rcube_event.get_mouse_pos(e); |
| | | |
| | | if (this.relative) { |
| | |
| | | |
| | | this.p1pos = this.relative ? $(this.p1).position() : $(this.p1).offset(); |
| | | this.p2pos = this.relative ? $(this.p2).position() : $(this.p2).offset(); |
| | | |
| | | return false; |
| | | }; |
| | | |
| | | /** |
| | |
| | | if (!me.drag_active) |
| | | return false; |
| | | |
| | | // with timing events dragging action is more responsive |
| | | window.clearTimeout(me.ts); |
| | | me.ts = window.setTimeout(function() { onDragAction(e); }, 1); |
| | | |
| | | return false; |
| | | }; |
| | | |
| | | /** |
| | | * Dragging action (see onDrag()) |
| | | */ |
| | | function onDragAction(e) |
| | | { |
| | | var pos = rcube_event.get_mouse_pos(e); |
| | | |
| | | if (me.relative) { |
| | |
| | | |
| | | me.p1pos = me.relative ? me.p1.position() : me.p1.offset(); |
| | | me.p2pos = me.relative ? me.p2.position() : me.p2.offset(); |
| | | return false; |
| | | }; |
| | | |
| | | /** |