Reagent: how do I add drag and drop event listeners properly?

691 views
Skip to first unread message

lei shulang

unread,
Apr 8, 2014, 5:43:12 PM4/8/14
to clojur...@googlegroups.com
I get that I can add :on-click etc. directly in hiccup. But how do I add drag and drop event listeners properly?

Christian Fortin

unread,
Apr 8, 2014, 8:13:29 PM4/8/14
to clojur...@googlegroups.com
On Tuesday, April 8, 2014 5:43:12 PM UTC-4, lei shulang wrote:
> I get that I can add :on-click etc. directly in hiccup. But how do I add drag and drop event listeners properly?

The same way you would for other events, such as your :on-click example.

Here's a little something to get you started:
https://www.refheap.com/73581

Also, getting info from things *while* you are dragging can be quite difficult.
I'd suggest using storage-atom for this: https://github.com/alandipert/storage-atom. It plays quite well with Reagent.

lei shulang

unread,
Apr 9, 2014, 5:11:35 PM4/9/14
to clojur...@googlegroups.com

Ah... thanks. Any reason why on-drag-over is used instead of ondragover/onDragOver etc.?

Frozenlock

unread,
Apr 9, 2014, 5:24:02 PM4/9/14
to clojur...@googlegroups.com
Not really... It's more clojure-y :-)



--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/RTIPDlNFScI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply all
Reply to author
Forward
0 new messages