Skip to content
Snippets Groups Projects
Commit f2465ca1 authored by syuilo's avatar syuilo
Browse files

fix(client): Fix bug that cannot set custom texture

parent 0294061c
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
<div v-for="k in Object.keys(selectedFurnitureInfo.props)" :key="k">
<p>{{ k }}</p>
<template v-if="selectedFurnitureInfo.props[k] === 'image'">
<mk-button @click="chooseImage(k)">{{ $t('_rooms.chooseImage') }}</mk-button>
<mk-button @click="chooseImage(k, $event)">{{ $t('_rooms.chooseImage') }}</mk-button>
</template>
<template v-else-if="selectedFurnitureInfo.props[k] === 'color'">
<input type="color" :value="selectedFurnitureProps ? selectedFurnitureProps[k] : null" @change="updateColor(k, $event)"/>
......@@ -69,6 +69,7 @@ import { faSave, faTrashAlt } from '@fortawesome/free-regular-svg-icons';
import { query as urlQuery } from '../../../prelude/url';
import MkButton from '../../components/ui/button.vue';
import MkSelect from '../../components/ui/select.vue';
import { selectFile } from '../../scripts/select-file';
let room: Room;
......@@ -224,10 +225,8 @@ export default Vue.extend({
});
},
chooseImage(key) {
this.$chooseDriveFile({
multiple: false
}).then(file => {
chooseImage(key, e) {
selectFile(this, e.currentTarget || e.target, null, false).then(file => {
room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`);
this.$refs.preview.selected(room.getSelectedObject());
this.changed = true;
......
......@@ -51,6 +51,7 @@ export function selectFile(component: any, src: any, label: string | null, multi
});
};
// TODO
const chooseFileFromUrl = () => {
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment