Skip to content

Commit

Permalink
refactor lightbox
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and tiensonqin committed Jul 9, 2023
1 parent 0a9c9e0 commit 9628560
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/main/frontend/extensions/lightbox.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
[cljs-bean.core :as bean]
[frontend.util :as util]))

(defn load-base-assets$
[]
(util/js-load$ (str util/JS_ROOT "/photoswipe.umd.min.js"))
(util/js-load$ (str util/JS_ROOT "/photoswipe-lightbox.umd.min.js")))

(defn preview-images!
[images]

(p/let [_ (load-base-assets$)]
(p/let [_ (util/js-load$ (str util/JS_ROOT "/photoswipe.umd.min.js"))
_ (util/js-load$ (str util/JS_ROOT "/photoswipe-lightbox.umd.min.js"))]
(let [options {:dataSource images :pswpModule js/window.PhotoSwipe :showHideAnimationType "fade"}
^js lightbox (js/window.PhotoSwipeLightbox. (bean/->js options))]
(doto lightbox
Expand Down

0 comments on commit 9628560

Please sign in to comment.