From 68e31f38be33121398f767b960676cc1207350d1 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 11 Feb 2009 00:46:37 -0800 Subject: [PATCH] Got note drag-and-drop working in WebKit. --- static/css/style.css | 4 ++++ static/js/Editor.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/static/css/style.css b/static/css/style.css index 670c90e..18c048a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -3,6 +3,8 @@ html, body { background-color: #fafafa; text-align: center; font-family: sans-serif; + -moz-user-select: none; + -webkit-user-select: none; } a { @@ -599,6 +601,7 @@ h1 { -moz-border-radius-bottomright: 5px; -webkit-border-radius: 5px; -moz-user-select: none; + -webkit-user-select: none; color: #fafafa; background-color: #fafafa; min-width: 20px; @@ -910,6 +913,7 @@ h1 { .pulldown_label { -moz-user-select: none; + -webkit-user-select: none; color: #000000; text-decoration: none; } diff --git a/static/js/Editor.js b/static/js/Editor.js index f41a789..3f172e2 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -784,6 +784,10 @@ Editor.prototype.drag = function( event ) { var drop_target = drop_targets[ i ]; var target_position = getElementPosition( drop_target ); var target_size = getElementDimensions( drop_target ); + if ( WEBKIT ) { + target_position.x -= viewport_position.x; + target_position.y -= viewport_position.y; + } // if the div is wholly above or below the drop target, then it's not overlapping it if ( ( div_position.y < target_position.y && div_position.y + div_size.h < target_position.y ) ||