https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • a

    adorable-fish-28954

    09/29/2022, 8:35 PM
    sweet. will keep an eye out for it
  • f

    freezing-waitress-26396

    09/29/2022, 8:35 PM
    Oh ok I didn't misunderstand then 😄
  • c

    clean-arm-73414

    09/29/2022, 8:39 PM
    can I also add multiple classes to this : on htmx:afterOnLoad take .active for event.target
  • m

    mysterious-toddler-20573

    09/29/2022, 8:39 PM
    lemme look
  • m

    mysterious-toddler-20573

    09/29/2022, 8:40 PM
    https://hyperscript.org/commands/take/
  • m

    mysterious-toddler-20573

    09/29/2022, 8:40 PM
    looks like no, currently only allows one
  • m

    mysterious-toddler-20573

    09/29/2022, 8:40 PM
    but you can have multiple
    take
    commands
  • m

    mysterious-toddler-20573

    09/29/2022, 8:40 PM
    a bit more verbose than I'd like
  • m

    mysterious-toddler-20573

    09/29/2022, 8:40 PM
    but it'll work for now
  • m

    mysterious-toddler-20573

    09/29/2022, 8:41 PM
    (checking the hyperscript source code, in case the docs are lying)
  • f

    freezing-waitress-26396

    09/29/2022, 8:41 PM
    hyperscript is humble, it only takes one
  • c

    clean-arm-73414

    09/29/2022, 8:42 PM
    hmm, multiple ? so as in
    on htmx:afterOnLoad take .classA for event.target take .classB for event.target
  • f

    freezing-waitress-26396

    09/29/2022, 8:42 PM
    then take
  • c

    clean-arm-73414

    09/29/2022, 8:42 PM
    alright
  • m

    mysterious-toddler-20573

    09/29/2022, 8:42 PM
    sadly, the docs are right:
  • m

    mysterious-toddler-20573

    09/29/2022, 8:42 PM
    https://github.com/bigskysoftware/_hyperscript/blob/1c093f7f8a2cfb456e7664f479fc687fb5486f33/www/js/lib/web.js#L477
  • m

    mysterious-toddler-20573

    09/29/2022, 8:42 PM
    Copy code
    applescript
    on htmx:afterOnLoad 
       take .classA for event.target 
       take .classB for event.target
  • m

    mysterious-toddler-20573

    09/29/2022, 8:43 PM
    or, I like using `then`:
  • m

    mysterious-toddler-20573

    09/29/2022, 8:43 PM
    Copy code
    applescript
    on htmx:afterOnLoad 
       take .classA for event.target then 
       take .classB for event.target
  • m

    mysterious-toddler-20573

    09/29/2022, 8:43 PM
    btw, you can kinda fake syntax highlighting for hyperscript by using the applescript option:
  • c

    clean-arm-73414

    09/29/2022, 8:44 PM
    pretty cool. working on a startup using htmx, was sceptical , but it's quite fun..
  • m

    mysterious-toddler-20573

    09/29/2022, 8:44 PM
    🙂
  • m

    mysterious-toddler-20573

    09/29/2022, 8:44 PM
    well, this is hyperscript
  • m

    mysterious-toddler-20573

    09/29/2022, 8:44 PM
    so a companion project
  • m

    mysterious-toddler-20573

    09/29/2022, 8:44 PM
    make sure hyperscript is installed too btw!
  • c

    clean-arm-73414

    09/29/2022, 8:44 PM
    well, wasnt familiar with either
  • m

    mysterious-toddler-20573

    09/29/2022, 8:44 PM
    but the two work well together, because they were designed by the same lunatic
  • c

    clean-arm-73414

    09/29/2022, 8:44 PM
    lol
  • c

    clean-arm-73414

    09/29/2022, 8:45 PM
    It takes one to know one!
  • f

    freezing-waitress-26396

    09/29/2022, 8:45 PM
    it fits well because hyperscript on an element swapped in with htmx will work out of the box
1...841842843...1146Latest