diff --git a/src/apps/muscles/app.jl b/src/apps/muscles/app.jl index 61c0e80282e1e2acef12a0cc88b5db4c78b12ff9..0ba369b7d399205f172800a7c8f65f7fc98220ab 100644 --- a/src/apps/muscles/app.jl +++ b/src/apps/muscles/app.jl @@ -51,6 +51,7 @@ const bonito_app = NamedApp(:inherit, Backbone.app) @out new_clipboard_item = false @in delete_sequence_click = false + @out no_sequences_yet = true @onchange isready begin _, url = init_model(__model__) @@ -151,6 +152,8 @@ const bonito_app = NamedApp(:inherit, Backbone.app) notify(start_time) notify(time_interval) notify(series_length) + # enable the download and delete buttons + no_sequences_yet = false # toggle edit mode on editmode = true end @@ -280,6 +283,8 @@ const bonito_app = NamedApp(:inherit, Backbone.app) end # reset fileuploads = empty!(fileuploads) + # enable the download and delete buttons + no_sequences_yet = false end end @@ -309,6 +314,8 @@ const bonito_app = NamedApp(:inherit, Backbone.app) selected_sequence_name = "" # update the view sequence_name = "" + # disable the download and delete buttons (view) + no_sequences_yet = true # update the model model.sequence[] = sequence else @@ -338,7 +345,7 @@ function muscle_view(bonito_url=""; channel=":channel") label="Upload motor program(s)", autoupload=true, hideuploadbtn=true, class="no-file-listing", id="uploader", url="/____/upload/$channel")), item(btn("Download motor program", @click(:export_sequence_click), color="primary", - loading=:export_sequence_click, + loading=:export_sequence_click, disable=:no_sequences_yet, [tooltip("Download the current motor program as a JSON file")])), dropdown(:selected_sequence_name, :sequence_names, "Motor program", class="sequence-list"), @@ -362,7 +369,8 @@ function muscle_view(bonito_url=""; channel=":channel") textfield("Start time", :start_time, type="number", step="any", disable=:editmode_disable), ]), - item(btn("Delete motor program", @click(:delete_sequence_click), color="negative")), + item(btn("Delete motor program", @click(:delete_sequence_click), color="negative", + disable=:no_sequences_yet)), ]) Html.div(style=col, [