diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2009-08-12 20:03:44 +0200 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2009-08-12 20:03:44 +0200 |
commit | 6977dceff2f79ba3dc75e6d3d47eaf16aad3fb8f (patch) | |
tree | 409bca8ef1f93232ef4b97f9cf279ad9b3d35d70 | |
parent | 56dfcc12d4d4b326fc393a8271da0cf8374d3a11 (diff) | |
download | dokuwiki-6977dceff2f79ba3dc75e6d3d47eaf16aad3fb8f.tar.gz dokuwiki-6977dceff2f79ba3dc75e6d3d47eaf16aad3fb8f.zip |
make dragged objects stylable via CSS
Ignore-this: ae47b532b80d10868e82e0ccc5c963d1
A DOM object that is dragged through the new drag Object gets the ondrag
assigned.
note: development was part of the ICKE 2.0 project see
http://www.icke-projekt.de for info
darcs-hash:20090812180344-6e07b-a50d6589f0650897ddd5f5d345a3d15513aada77.gz
-rw-r--r-- | lib/scripts/drag.js | 8 | ||||
-rw-r--r-- | lib/tpl/default/_linkwiz.css | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/scripts/drag.js b/lib/scripts/drag.js index aefe8af52..1294be602 100644 --- a/lib/scripts/drag.js +++ b/lib/scripts/drag.js @@ -37,14 +37,15 @@ drag = { */ start: function (e){ drag.handle = e.target; - drag.handle.style.cursor = 'move'; - if(drag.handle.dragobject){ drag.obj = drag.handle.dragobject; }else{ drag.obj = drag.handle; } + drag.handle.className += ' ondrag'; + drag.obj.className += ' ondrag'; + drag.oX = parseInt(drag.obj.style.left); drag.oY = parseInt(drag.obj.style.top); drag.eX = drag.evX(e); @@ -62,7 +63,8 @@ drag = { * Ends the dragging operation */ stop: function(){ - drag.handle.style.cursor = ''; + drag.handle.className = drag.handle.className.replace(/ ?ondrag/,''); + drag.obj.className = drag.obj.className.replace(/ ?ondrag/,''); removeEvent(document,'mousemove',drag.drag); removeEvent(document,'mouseup',drag.stop); drag.obj = null; diff --git a/lib/tpl/default/_linkwiz.css b/lib/tpl/default/_linkwiz.css index 2a6a8997d..9ae61bffe 100644 --- a/lib/tpl/default/_linkwiz.css +++ b/lib/tpl/default/_linkwiz.css @@ -1,4 +1,3 @@ - #link__wiz { position: absolute; display: block; @@ -56,3 +55,8 @@ color: __text_neu__ } +/*FIXME maybe move to a more general style sheet*/ +.ondrag { + cursor: move; + opacity: 0.8; +} |