Fork me on GitHub
#hoplon
<
2017-05-24
>
mudphone02:05:20

Any Bootstrap users have trouble with the collapsed Navbar button and Hoplon? When it turns into a button, I can’t trigger the drop-down menu (same as the example component). I had it working with Reagent and switched to Hoplon and now clears the screen (no body). I worked my example down to only this element and it seems to still be broken.

mudphone04:05:44

I figured out that Bootstrap’s navbar collapsing breaks if I require hoplon.svg

mudphone04:05:18

(ns hoaka.ipp.nav
  (:require
   ...
   [hoplon.svg :as svg]))

mudphone04:05:16

I created a minimal repo with the Bootstrap navbar and nothing else but a require for Hoplon.SVG here: https://github.com/mudphone/HoplonNavbarSvgProblem

mudphone04:05:30

If I literally cut&paste the entire hoplon.svg ns file into my app and rename the ns, the dropdown works.

jouerose09:05:08

is an hoplon book in the plan? what do you think are the topics that should be in it ?

cpmcdaniel11:05:39

I think we first need to improve the online docs

jouerose12:05:43

@cpmcdaniel from your perspective, what should be done online ? what would be your contents page ?

cpmcdaniel12:05:03

I would focus less on how it works and more on how to use it

cpmcdaniel12:05:14

more examples and walkthroughs

cpmcdaniel12:05:56

also, from my perspective, it’s not just hoplon that is a hurdle, but ClojureScript itself

cpmcdaniel12:05:17

I feel hoplon is easier to learn than the other cljs frameworks. That makes it a good entry point for someone new to cljs.

cpmcdaniel12:05:46

so perhaps a primer for cljs - at least the parts that apply to hoplon

cpmcdaniel12:05:27

the most immediately obvious is the various event handlers and getting things like (.-key event), etc.

cpmcdaniel12:05:49

I know we don’t want to repeat the jquery docs, but a handful of examples that show how to translate a few jquery api calls into cljs and a link to the full jquery api would be a good start

jouerose14:05:16

@cpmcdaniel how to use it , indeed

jouerose17:05:03

hi, what is the advised way to get an element by id ?

dm317:05:33

@jouerose ideally you shouldn’t be doing that in Hoplon. If you really need to - jquery/native JS functions.

jouerose18:05:06

@dm3 say i have a input text and a button, i want to set some new text to the input text when the button is clicked. what is your advise on doing it ?

dm318:05:41

(defc text "initial text")
(div 
  (input :value (cell= (string/to-upper-case text)))
  (button :click #(reset! text "clicked!"))

dm318:05:14

uppercase to make more interesting

dm318:05:28

you’ll need to handle additional events (e.g. :change) on the input in order to make the input react when being typed into