Fork me on GitHub
#hoplon
<
2016-08-29
>
onetom05:08:34

@jumblerg thanks for the latest hoplon ui commits (submit & route)! @chark has also found the reason why the password input type didn't work; that's what the latest pull request is about (the other commits are just "technical - fckin git - noise"; sorry for that) it means we can sync our hoplon/ui fork with the official again.

onetom06:08:41

some reference of debounce: https://en.wikipedia.org/wiki/Switch#Contact_bounce since i did quite some micro-controller programming, to me debounce means delay acting on an event until we are sure it has happened (a switch press for example). it seems one major difference from throttle is that throttle reacts immediately.

beatngu1307:08:59

I have a list element which is structured like this: (li … (span … ) (div … )). Now, when span is clicked I’d like to toggle the visibility of the following div. I thought about something like next().toggle() but I’m struggling with the interop syntax… 💩 Any suggestions?

flyboarder17:08:15

@beatngu13 there is a much more hoplon way of doing that 🙂

alandipert18:08:12

(defc my-toggler false)

(li
  (span :click #(swap! my-toggler not))
  (div :toggle my-toggler))

flyboarder18:08:16

@alandipert is right, thats probably what you want @beatngu13

alandipert18:08:57

i haven't had a chance yet to try our app w/ the hoplon 7 goodness

alandipert18:08:04

hope to achieve that this week so we can cut v7

beatngu1318:08:32

Thanks @flyboarder and @alandipert. I should have mentioned that the list is created dynamically with many li items. I could create a map (e.g. :id toggle-state) on the fly, but this might create many cells. That’s why I thought something like next().toggle() would be easier. What do you think?

flyboarder19:08:33

@beatngu13 so in that case I would still go with alans version, except create a local cell for each li litem

alandipert19:08:38

@beatngu13 when someone clicks do you want to remove the element from the original list?

beatngu1319:08:21

span contains general informations and the div opens a detail view which I’d like to toggle when the user clicks on the list item.

alandipert19:08:21

@beatngu13 in your case i would recommend adding an argument to your offer-list-item function

alandipert19:08:27

that takes a cell of whether or not to display details

alandipert19:08:39

so that when you're "iterating" in a for-tpl you can pass it a cell

alandipert19:08:07

alternatively you could move creating/managing the cell into your function

beatngu1319:08:33

Great, thanks @alandipert I'll try that out.