                    :href         (str "http://" @appshare-dev-server ":3450")}
                   "Run in own window")
 
-               (button {:className    "btn btn-default"
-                        :style       {:display "inline-block" :marginLeft "30px" :fontFamily "Ubuntu" :fontSize "1em" :marginTop "-0.3em"  }
-                        :onClick     #(reeval  (read-ui app [:app-id]))}
-                       "Save")))
+               ))
+
+
+
+            (button {:className    "btn-lg btn-default"
+                        :style       {:display "inline-block" :marginLeft "30px" :fontFamily "Ubuntu" :fontSize "1em" :marginTop "-0.3em"
+                                      :opacity  (if (= (read-ui app [:mode]) "edit")  "1.0" "0.4")
+
+                                      }
+                        :onClick     #(do
+                                        (write-ui app [:mode] "view")
+                                        (reeval  (read-ui app [:app-id])))
+                     :disabled  (if (= (read-ui app [:mode]) "edit") "" "true")
+                     }
+                       "Save")
 
             (a {:target       "appshare.co"
                 :style       {:textDecoration "underline" :float "right"  :display "inline-block" :marginRight "30px" :fontFamily "Ubuntu" :fontSize "2em" :marginTop "0.3em"}

               "AppShare on Github"))




       (div {}
            (div {:style {:display "inline-block" :width "1200" :height "800" :verticalAlign "top"}}
                 (cond
                   (or (= (read-ui app [:mode]) nil) (= (read-ui app [:mode]) "browse"))
                   (component browser-component app [])

                   (= (read-ui app [:mode]) "edit")
                   (component editor-component app [])

                   :else
                   (div {} "Nothing selected")))



       (iframe {:id "appframe" :style {:display "inline-block"} :src
                (str (cond
                      @c/debug-mode
                      "http://127.0.0.1:3449"

                      :else
                      "http://appshare.co/appshare")
                     "/devclient.html") :width "600" :height "800"}))
       ))



       (div {:style     {:border "0px" :backgroundColor "black" :width "100%" :height "3em" :verticalAlign "top"}}
            (img {:style {:display "inline-block" :marginTop "-0.0em"} :src "appshare_logo_dark_background.png"})

            (button {:className    "btn-lg btn-default"
                     :style       {:display "inline-block" :marginLeft "30px" :fontFamily "Ubuntu" :fontSize "1em" :marginTop "-0.3em"}
                     :onClick     #(write-ui app [:mode] "browse")} "Home")

            (button {:className    "btn-lg btn-default"
                     :style       {:display "inline-block" :marginLeft "30px" :fontFamily "Ubuntu" :fontSize "1em" :marginTop "-0.3em"
                                   :opacity (if (or (= (read-ui app [:mode]) nil) (= (read-ui app [:mode]) "browse")) "1.0" "0.4")
                                   }
                     :disabled  (if (or (= (read-ui app [:mode]) nil) (= (read-ui app [:mode]) "browse")) "" "true")
                     :onClick     #(go
                                      (remote !newapp {})) } "New")

            (button {:style {:marginBottom "10px" :marginLeft "30px"

                             :opacity  (if (= (read-ui app [:mode]) "view")  "1.0" "0.4")

                             } :className "btn-lg btn-default"
                             :onClick     #(go (write-ui app [:mode] "edit")
                                             ;(remote !loadapp {:id (read-ui app [:app-id])})
                                             )
                     :disabled  (if (= (read-ui app [:mode]) "view") "" "true")

                             } "Edit")


            (cond
