summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-08-24 17:10:23 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-08-24 17:10:23 +0000
commit5c859a038b195cbe465fe40ebe66a2a8d63c13db (patch)
tree42e314979163705f534bdfb09439403e6d838d95
parent29ed0009c454ba57a7c550285d579a2e40bac922 (diff)
- Fix selection disabling while dragging splitter in webkit browsers (#1486056)
git-svn-id: https://svn.roundcube.net/trunk@2866 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/CHANGELOG1
-rw-r--r--roundcubemail/skins/default/splitter.js10
2 files changed, 10 insertions, 1 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG
index 09c2de7ed..64855e0cb 100644
--- a/roundcubemail/CHANGELOG
+++ b/roundcubemail/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Fix selection disabling while dragging splitter in webkit browsers (#1486056)
- Added 'new_messages' plugin hook (#1486005)
- Added 'logout_after' plugin hook (#1486042)
- Added 'message_compose' hook
diff --git a/roundcubemail/skins/default/splitter.js b/roundcubemail/skins/default/splitter.js
index 74c751c2b..83506eecb 100644
--- a/roundcubemail/skins/default/splitter.js
+++ b/roundcubemail/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'});