Fix poster box
This commit is contained in:
@@ -93,10 +93,7 @@ export default {
|
|||||||
closeMarkerPopup: this.closeMarkerPopup,
|
closeMarkerPopup: this.closeMarkerPopup,
|
||||||
isMarkerVisible: this.isMarkerVisible
|
isMarkerVisible: this.isMarkerVisible
|
||||||
},
|
},
|
||||||
project: {
|
project: this
|
||||||
...this.$data,
|
|
||||||
toggleFeedPanel: this.toggleFeedPanel
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
inject: ['spot', 'projects', 'user'],
|
inject: ['spot', 'projects', 'user'],
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
import { LngLat } from 'maplibre-gl';
|
import { LngLat } from 'maplibre-gl';
|
||||||
|
|
||||||
import autosize from 'autosize';
|
import autosize from 'autosize';
|
||||||
|
import { registerRuntimeCompiler } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -28,7 +29,9 @@
|
|||||||
anchorVisible: ['message', 'media', 'post'].includes(this.options.type),
|
anchorVisible: ['message', 'media', 'post'].includes(this.options.type),
|
||||||
anchorTitle: this.spot.lang('copy_to_clipboard'),
|
anchorTitle: this.spot.lang('copy_to_clipboard'),
|
||||||
anchorIcon: 'link',
|
anchorIcon: 'link',
|
||||||
popupRequested: false
|
popupRequested: false,
|
||||||
|
postMessage: '',
|
||||||
|
sending: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -60,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
inject: ['spot', 'project', 'user', 'map', 'project'],
|
inject: ['spot', 'project', 'user', 'map'],
|
||||||
methods: {
|
methods: {
|
||||||
copyAnchor() {
|
copyAnchor() {
|
||||||
copyTextToClipboard(this.spot.consts.server+this.spot.hash());
|
copyTextToClipboard(this.spot.consts.server+this.spot.hash());
|
||||||
@@ -86,6 +89,27 @@
|
|||||||
closeMarkerPopup() {
|
closeMarkerPopup() {
|
||||||
if(!this.popupRequested) this.map.closeMarkerPopup();
|
if(!this.popupRequested) this.map.closeMarkerPopup();
|
||||||
this.popupRequested = false;
|
this.popupRequested = false;
|
||||||
|
},
|
||||||
|
send() {
|
||||||
|
if(this.postMessage != '' && this.user.name != '') {
|
||||||
|
this.sending = true;
|
||||||
|
this.spot.get2(
|
||||||
|
'add_post',
|
||||||
|
{
|
||||||
|
id_project: this.project.currProject.id,
|
||||||
|
name: this.user.name,
|
||||||
|
content: this.postMessage
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.postMessage = '';
|
||||||
|
this.project.checkNewFeed();
|
||||||
|
this.sending = false;
|
||||||
|
})
|
||||||
|
.catch((sDesc) => {
|
||||||
|
this.sending = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -144,9 +168,9 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p v-else-if="options.type == 'poster'" class="message">
|
<p v-else-if="options.type == 'poster'" class="message">
|
||||||
<textarea ref="post" name="post" :placeholder="spot.lang('post_message')" class="autoExpand" rows="1" v-model="$parent.post"></textarea>
|
<textarea ref="post" name="post" :placeholder="spot.lang('post_message')" class="autoExpand" rows="1" v-model="postMessage"></textarea>
|
||||||
<input type="text" name="name" :placeholder="spot.lang('post_name')" v-model="user.name" />
|
<input type="text" name="name" :placeholder="spot.lang('post_name')" v-model="user.name" />
|
||||||
<spotButton name="submit" :aria-label="spot.lang('send')" :title="spot.lang('send')" :icon="'send'" />
|
<spotButton name="submit" :aria-label="spot.lang('send')" :title="spot.lang('send')" :icon="'send'" @click="send()" :iconClasses="sending?'flicker':''" />
|
||||||
</p>
|
</p>
|
||||||
<div v-else-if="options.type == 'archived'">
|
<div v-else-if="options.type == 'archived'">
|
||||||
<p><spotIcon :icon="'success'" /></p>
|
<p><spotIcon :icon="'success'" /></p>
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
classes: String,
|
classes: String,
|
||||||
text: String,
|
text: String,
|
||||||
icon: String
|
icon: String,
|
||||||
|
iconClasses: String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<button :class="classes"><SpotIcon :icon="icon" :text="text" /></button>
|
<button :class="classes"><SpotIcon :icon="icon" :text="text" :classes="iconClasses" /></button>
|
||||||
</template>
|
</template>
|
||||||
Reference in New Issue
Block a user