From 571c109260fb8455594173f1ed6739f7351f53e1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 22 Nov 2013 07:37:03 -0500 Subject: [PATCH] Make splitters more responsive (using timing events) --- skins/classic/splitter.js | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/skins/classic/splitter.js b/skins/classic/splitter.js index 72ada57..b94f0bd 100644 --- a/skins/classic/splitter.js +++ b/skins/classic/splitter.js @@ -124,6 +124,17 @@ 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) { @@ -147,8 +158,6 @@ this.p1pos = this.relative ? $(this.p1).position() : $(this.p1).offset(); this.p2pos = this.relative ? $(this.p2).position() : $(this.p2).offset(); - - return false; }; /** -- Gitblit v1.9.1