Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (re-frame/reg-event-db
- ::set-slide-window
- [re-frame/trim-v]
- (fn [db [show? template]]
- (assoc db :slide-template {:show? show?
- :template template})))
- (defn slide-panel
- []
- (let [left-position-template (re-frame/subscribe [::subs/left-position-slide-panel])
- menu-panel-width (re-frame/subscribe [::subs/menu-panel-width])
- slide-panel-template (re-frame/subscribe [::subs/slide-panel-template])]
- (fn []
- [:div#menu-backdrop
- {:style {:left @left-position-template}
- :on-click #(if (= (.-currentTarget %) (.-target %))
- (re-frame/dispatch [::common-events/set-slide-window false nil])
- false)}
- [:div#slide-panel
- {:style {:left @left-position-template
- :width @menu-panel-width}}
- (case @slide-panel-template
- :menu [menu-view/menu-view]
- :dish [dish/dish]
- [:h1 "Нет шаблона"])]])))
- (defn new-sale-receipt
- []
- ...
- [:button.add-dish
- {:on-click #(re-frame/dispatch [::common-events/set-slide-window true :menu])} ; <-- Invoke slide-meny animation
- "Б+"]
- ...)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement