From 29547e12be239e88a84575b368fa5a21b370f78f Mon Sep 17 00:00:00 2001 From: Nicholas Kariniemi Date: Sat, 9 Aug 2014 00:08:06 +0300 Subject: [PATCH] Hide add grubs button when editing --- src/cljs/grub/view/recipe.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cljs/grub/view/recipe.cljs b/src/cljs/grub/view/recipe.cljs index 05c62bc..1c82033 100644 --- a/src/cljs/grub/view/recipe.cljs +++ b/src/cljs/grub/view/recipe.cljs @@ -47,6 +47,7 @@ [:editing :waiting] (let [update-ch (om/get-shared owner :recipe-update) id (:id @(om/get-props owner)) name (om/get-state owner :name) + grubs (om/get-state owner :grubs) event (update-event id name grubs)] (put! update-ch event)) @@ -89,9 +90,10 @@ :on-change #(om/set-state! owner :name (dom/event-val %))}] [:button.btn.btn-primary.btn-sm.recipe-add-grubs-btn {:type "button" + :class (when (= edit-state :editing) "hidden") :ref :add-grubs-btn :on-click #(add-grubs add-grubs-ch grubs)} - "Add Grubs"]] + "Add grubs"]] [:div.panel-body.recipe-grubs {:class (when (= edit-state :waiting) "hidden")} [:textarea.form-control.recipe-grubs-input