Skip to content
Snippets Groups Projects
Commit 6977dcef authored by Andreas Gohr's avatar Andreas Gohr
Browse files

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
parent 56dfcc12
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
#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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment