summaryrefslogtreecommitdiff
path: root/skins
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-08-24 17:10:23 +0000
committeralecpl <alec@alec.pl>2009-08-24 17:10:23 +0000
commitf9aeecd579ab5bf9b260809b8f2435cbd81c155b (patch)
treef5951c5120da57187aa82ed17c68495373b9eb57 /skins
parentd343336772509094427346604a8f6bc7585cfbee (diff)
- Fix selection disabling while dragging splitter in webkit browsers (#1486056)
Diffstat (limited to 'skins')
-rw-r--r--skins/default/splitter.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/skins/default/splitter.js b/skins/default/splitter.js
index 74c751c2b..83506eecb 100644
--- a/skins/default/splitter.js
+++ b/skins/default/splitter.js
@@ -94,10 +94,14 @@ function rcube_splitter(attrib)
*/
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'});
@@ -177,6 +181,10 @@ function rcube_splitter(attrib)
*/
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'});