'On Drop' event listener

414 views
Skip to first unread message

pu...@algumacoisa.org

unread,
Dec 15, 2014, 11:05:40 AM12/15/14
to jsp...@googlegroups.com
Hello, I'm trying to apply a drag&drop interface to add/remove elements to/from my 'canvas'..
I think the usual approach would make an element draggable and listen on 'drop' event so I could do stuff when the user drops the element inside the canvas or in the elements panel.
I took a good look at the docs and katavorio source code but couldn't find anything that would make possible to do that.
I appreciate any feedback, since I'm quite stuck..
Ty

Actually I probably need to listen to on DROP in the canvas.. Still no success.

pu...@algumacoisa.org

unread,
Dec 15, 2014, 11:45:43 AM12/15/14
to jsp...@googlegroups.com
It seems katavorio draggable() function can  handle start/drag/end callbacks  as seen at  https://github.com/jsplumb/katavorio/wiki#lifecycle-events. So that solved it:
jsPlumb.draggable(elem[0],
               
{
                    grid
: [20, 20],
                    stop
:function(params) {
                        console
.log(params);
                        console
.log("DragEND!");
                   
}


               
}
           
);
Reply all
Reply to author
Forward
0 new messages