Fork me on GitHub
#hoplon
<
2016-04-07
>
leontalbot01:04:25

@micha: I finally could make a new cljsjs lib!

leontalbot01:04:43

cljsjs/tabletop

leontalbot01:04:33

I fetch the data from a google sheet. I do:

(defc static-content nil)

(with-init!
  (.init js/Tabletop
         (clj->js
          {:key static-content-sheet
           :callback #(reset! static-content (js->clj %))
           :simpleSheet true})))

leontalbot01:04:45

(my-element :bg (get @static-content "background-img-url")) doesn't give my anything. (because the reset of the cell occurs after my-element get the background img url...) and (my-element :bg (cell-path static-content ["background-img-url"])) doesn't deref...

micha01:04:52

@leontalbot: what is the :bg attribute there?

leontalbot01:04:33

ahh... :style (str .... bg ....)

leontalbot01:04:59

should be :css right?

micha01:04:11

maybe try like

micha01:04:53

(my-element :css (cell= {:background-image (get static-content "background-image")}) ...

micha01:04:57

or someting like that?

leontalbot01:04:13

how would you translate this in hlisp background-image: url("paper.gif");?

leontalbot01:04:27

ok yeah (str "url('" image-url "')

micha01:04:30

i think like :css {:background-image "url(\"paper.gif\")"}

leontalbot01:04:29

can't see bg

leontalbot01:04:17

I can see the data with (text "~{static-content}")

leontalbot02:04:22

@micha apologies you were right!

leontalbot03:04:12

Thanks man, works great!

piotrek06:04:03

@onetom Thanks for the example!

leontalbot22:04:15

Hello. Do I need to require case-tplto use it? I get WARNING: Use of undeclared Var app.views/case-tpl I suppose it should be hoplon.core/case-tpl any ideas why and what should I do? I am using alpha13 thanks!

leontalbot22:04:59

weird because I use another macro loop-tpl without any warnings...

raywillig22:04:01

@leontalbot: I think those new macros are in master repo but not on clojars. You could clone the repo and then do boot Pom jar install or maybe there is an all in one task in build.boot

micha22:04:02

yep, what @raywillig said, or boot build-jar in the hoplon git directory

micha22:04:37

i think there are instructions in the hoplon project README

micha23:04:09

i'll make a new alpha release