Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp committed Feb 8, 2024
1 parent dbb3360 commit 77f6490
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 54 deletions.
45 changes: 4 additions & 41 deletions resources/js/Components/Editor/Components/Modals/EditImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,17 @@ const props = defineProps({
modelValue: {
type: [String, null],
},
href: {
required: true,
},
alt: {
required: true,
},
height: {
required: true,
},
fit: {
required: true,
},
target: {
required: true,
},
})
const emits = defineEmits([
'update:href',
'update:alt',
'update:height',
'update:fit',
'update:target',
])
const {
href: computedHref,
alt: computedAlt,
height: computedHeight,
fit: computedFit,
target: computedTarget,
} = useVModels(props, emits)
const emits = defineEmits(['update:alt', 'update:height'])
const { alt: computedAlt, height: computedHeight, fit: computedFit } = useVModels(props, emits)
const path = ''
const errors = ref({})
Expand Down Expand Up @@ -93,11 +72,6 @@ watch(
<Modal :open="open" @close="emits('close')">
<ImageUpload v-model="form.file" :current-image="path" :error="errors['file']" />

<div>
<label for="href">Link</label>
<TextInput v-model="computedHref" description="Link to somewhere" />
</div>

<div>
<label for="alt"> Alt</label>
<TextInput v-model="computedAlt" />
Expand Down Expand Up @@ -140,18 +114,7 @@ watch(
v-model="computedHeight"
/>
</div>

<div>
<label for="fit"> Image fit</label>
<select v-model="computedFit">
<option value="none" selected>None</option>
<option value="contain">Contain</option>
<option value="cover">Cover</option>
<option value="fill">Fill</option>
<option value="scale-down">Scale down</option>
</select>
</div>


<PrimaryButton type="submit" @click.prevent="submit"> Save</PrimaryButton>
</Modal>
</template>
9 changes: 0 additions & 9 deletions resources/js/Components/Editor/Nodes/Image/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@ export default Node.create({
alt: {
default: null,
},
href: {
default: null,
},
height: {
default: 'full',
},
fit: {
default: 'none',
},
target: {
default: '_self',
},
}
},

Expand Down
5 changes: 1 addition & 4 deletions resources/js/Components/Editor/Nodes/Image/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const props = defineProps({
const open = ref(false)
let { src, href, alt, height, fit, target } = breakdownNodeViewProps(props)
let { src, alt, height } = breakdownNodeViewProps(props)
</script>

<template>
Expand All @@ -30,11 +30,8 @@ let { src, href, alt, height, fit, target } = breakdownNodeViewProps(props)
@close="open = false"
:open="open"
v-model="src"
v-model:href="href"
v-model:alt="alt"
v-model:height="height"
v-model:fit="fit"
v-model:target="target"
/>
</template>

Expand Down

0 comments on commit 77f6490

Please sign in to comment.