Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit f260732

Browse files
committed
FE WIP adjustments to save modal
- add checkbox for 'public' option - dont close modal immediately, maybe I'll add a visual indicator for a successful save, or perhaps a link to the newly created plan for sharing/bookmarking?
1 parent 862da97 commit f260732

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

Closure_Front_End/src/save-load/SaveAsModal.vue

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="field">
1717
<div class="control">
1818
<label class="checkbox">
19-
<input type="checkbox" v-model="publicize" :disabled="saving"/>
19+
<input type="checkbox" v-model="publicize" :disabled="saving" />
2020
ציבורי
2121
</label>
2222
</div>
@@ -26,14 +26,18 @@
2626
<div class="control">
2727
<button
2828
class="button is-link"
29-
:class="{ 'is-loading': saving }"
29+
:class="{ 'is-loading': saving, 'is-success': savedPlan }"
3030
@click="onSubmit"
3131
:disabled="!canSave || saving"
3232
>
33-
שמירה
33+
<span v-if="savedPlan">
34+
<i class="fas fa-check" />
35+
סיום
36+
</span>
37+
<span v-else>שמירה</span>
3438
</button>
3539
</div>
36-
<div class="control">
40+
<div class="control" v-if="!savedPlan">
3741
<button class="button is-link is-light" @click="$emit('close')">
3842
ביטול
3943
</button>
@@ -52,14 +56,20 @@ export default {
5256
name: "",
5357
publicize: false,
5458
saving: false,
55-
savedPlan: null
59+
savedPlan: null,
5660
});
5761
5862
const onSubmit = async () => {
63+
if (state.savedPlan !== null) {
64+
emit("close");
65+
return;
66+
}
5967
state.saving = true;
6068
try {
61-
state.savedPlan = await saveAs({ name: state.name, publicize: state.publicize });
62-
// emit("close");
69+
state.savedPlan = await saveAs({
70+
name: state.name,
71+
publicize: state.publicize,
72+
});
6373
} finally {
6474
state.saving = false;
6575
}
@@ -69,7 +79,7 @@ export default {
6979
return {
7080
...toRefs(state),
7181
canSave,
72-
onSubmit,
82+
onSubmit
7383
};
7484
},
7585
};

0 commit comments

Comments
 (0)