Is this the correct way to do a tooltip on a Reagent component?

206 views
Skip to first unread message

Jonathon McKitrick

unread,
Mar 25, 2015, 11:44:38 AM3/25/15
to clojur...@googlegroups.com
(defn edit-button-component [attrs]
[:button.btn.btn-default attrs
[:span.glyphicon.glyphicon-pencil]])

(defn edit-button-component-dec []
(with-meta edit-button-component
{:component-did-mount #(.tooltip (js/$ (reagent.core/dom-node %)) #js {:title "Test"})
:component-will-mount #(.log js/console "Mounting")}))

Colin Yates

unread,
Mar 25, 2015, 11:54:17 AM3/25/15
to clojur...@googlegroups.com
Might be my ignorance of reagent, but why can't you just {:title "My tooltip"} to the button itself:

[:button.btn.btn-default {:title "Woot"}]

jmcki...@gmail.com

unread,
Mar 25, 2015, 1:14:33 PM3/25/15
to clojur...@googlegroups.com
Well, actually, that might work.  I was hoping for something more attention-grabbing, but this will work for now.  Thanks!

--
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/zOdkVxzWsyY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescript+unsubscribe@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Colin Yates

unread,
Mar 25, 2015, 1:16:20 PM3/25/15
to clojur...@googlegroups.com
Looking at your code, I think your question is more about using the
jquery tooltip plugin, which I know even less about ;).
>> clojurescrip...@googlegroups.com.
>> To post to this group, send email to clojur...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/clojurescript.
>
> --
> Note that posts from new members are moderated - please be patient with your
> first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescrip...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages