Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanenko3 committed Jun 13, 2023
1 parent 5718db8 commit e79b6c0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
30 changes: 15 additions & 15 deletions dist/js/package.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/js/tool.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions resources/js/components/Browser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const props = defineProps({
},
});
const emit = defineEmits(["confirmSelect"]);
const emit = defineEmits(["confirmSelection"]);
// HOOKS
onMounted(() => {
Expand All @@ -120,7 +120,7 @@ onKeyStroke("Escape", (e) => {
});
watch(selectionConfirms, () => {
emit("confirmSelect", store.selection);
emit("confirmSelection", store.selection);
store.clearSelection();
store.closeModals();
Expand Down
12 changes: 8 additions & 4 deletions resources/js/components/BrowserModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
<Browser
:selecting="selecting"
:multiple="multiple"
@confirmSelect="
($event) => emit('confirmSelect', $event)
"
@confirmSelection="confirmSelection"
/>
</div>
</div>
Expand Down Expand Up @@ -45,7 +43,7 @@ const props = defineProps({
const store = useBrowserStore();
const emit = defineEmits(["update:state", "confirmSelect"]);
const emit = defineEmits(["update:state", "confirmSelection"]);
onKeyStroke("Escape", (e) => {
if (!store.modals.length) {
Expand All @@ -56,6 +54,12 @@ onKeyStroke("Escape", (e) => {
}
});
function confirmSelection(e) {
closeModal();
emit('confirmSelection', e)
}
function closeModal() {
emit("update:state", false);
}
Expand Down
4 changes: 2 additions & 2 deletions resources/js/pages/Tool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<BrowserModal
v-model:state="modalState"
@confirmSelect="confirmSelect"
@confirmSelection="confirmSelection"
/>
</div>
</template>
Expand All @@ -26,7 +26,7 @@ import Browser from "../components/Browser.vue";
const modalState = ref(false);
function confirmSelect(e) {
function confirmSelection(e) {
console.log(e);
modalState.value = false;
Expand Down

0 comments on commit e79b6c0

Please sign in to comment.