Forked from pbaille/gist:342e82365b28166f1ad7111029c2c641
Created
January 12, 2017 11:39
-
-
Save pesterhazy/245eea26b6e1ae09a1d9d3df724ddc7b to your computer and use it in GitHub Desktop.
Revisions
-
pesterhazy revised this gist
Jan 12, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ (fn [x] (reset! dims {:width (.-width @this) :height (.-height @this)}))}] [:div "Dimensions:" (pr-str @dims)]]))) (r/render-component [i] (js/document.getElementById "klipse-container")) -
pbaille revised this gist
Jan 12, 2017 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,16 @@ (require '[reagent.core :as r]) (defn i [] (let [dims (r/atom {}) this (r/atom nil)] (fn [][:div [:img {:style {:width :100%} :src "http://www.lispcast.com/img/pre-conj/rich-hickey.jpeg" :ref (fn [x] (reset! this x)) :on-load (fn [x] (reset! dims {:width (.-width @this) :height (.-height @this)}))}] [:div (pr-str @dims)]]))) (r/render-component [i] -
pbaille revised this gist
Jan 12, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,5 @@ :height (.-height this)})))}] [:div (pr-str @dims)]]))) (r/render-component [i] (js/document.getElementById "klipse-container")) -
pbaille created this gist
Jan 12, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ (require '[reagent.core :as r]) (defn i [] (let [dims (r/atom {})] (fn [][:div [:img {:style {:width :100%} :src "http://www.lispcast.com/img/pre-conj/rich-hickey.jpeg" :on-load (fn [x] (this-as this (js/console.log x) (js/console.log this) (reset! dims {:width (.-width this) :height (.-height this)})))}] [:div (pr-str @dims)]]))) [i]