This commit is contained in:
syuilo 2018-03-05 14:09:12 +09:00
parent 51e71d5870
commit ca30798910
3 changed files with 20 additions and 4 deletions

View file

@ -14,7 +14,8 @@
@posted="onPosted" @posted="onPosted"
@change-uploadings="onChangeUploadings" @change-uploadings="onChangeUploadings"
@change-attached-media="onChangeMedia" @change-attached-media="onChangeMedia"
@geo-attached="onGeoAttached"/> @geo-attached="onGeoAttached"
@geo-dettached="onGeoDettached"/>
</mk-window> </mk-window>
</template> </template>
@ -45,6 +46,9 @@ export default Vue.extend({
onGeoAttached(geo) { onGeoAttached(geo) {
this.geo = geo; this.geo = geo;
}, },
onGeoDettached() {
this.geo = null;
},
onPosted() { onPosted() {
(this.$refs.window as any).close(); (this.$refs.window as any).close();
} }

View file

@ -27,7 +27,7 @@
<button class="drive" title="%i18n:desktop.tags.mk-post-form.attach-media-from-drive%" @click="chooseFileFromDrive">%fa:cloud%</button> <button class="drive" title="%i18n:desktop.tags.mk-post-form.attach-media-from-drive%" @click="chooseFileFromDrive">%fa:cloud%</button>
<button class="kao" title="%i18n:desktop.tags.mk-post-form.insert-a-kao%" @click="kao">%fa:R smile%</button> <button class="kao" title="%i18n:desktop.tags.mk-post-form.insert-a-kao%" @click="kao">%fa:R smile%</button>
<button class="poll" title="%i18n:desktop.tags.mk-post-form.create-poll%" @click="poll = true">%fa:chart-pie%</button> <button class="poll" title="%i18n:desktop.tags.mk-post-form.create-poll%" @click="poll = true">%fa:chart-pie%</button>
<button class="geo" title="位置情報を添付する" @click="setGeo">%fa:map-marker-alt%</button> <button class="geo" title="位置情報を添付する" @click="geo ? removeGeo : setGeo">%fa:map-marker-alt%</button>
<p class="text-count" :class="{ over: text.length > 1000 }">{{ '%i18n:desktop.tags.mk-post-form.text-remain%'.replace('{}', 1000 - text.length) }}</p> <p class="text-count" :class="{ over: text.length > 1000 }">{{ '%i18n:desktop.tags.mk-post-form.text-remain%'.replace('{}', 1000 - text.length) }}</p>
<button :class="{ posting }" class="submit" :disabled="!canPost" @click="post"> <button :class="{ posting }" class="submit" :disabled="!canPost" @click="post">
{{ posting ? '%i18n:desktop.tags.mk-post-form.posting%' : submitText }}<mk-ellipsis v-if="posting"/> {{ posting ? '%i18n:desktop.tags.mk-post-form.posting%' : submitText }}<mk-ellipsis v-if="posting"/>
@ -210,6 +210,10 @@ export default Vue.extend({
enableHighAccuracy: true enableHighAccuracy: true
}); });
}, },
removeGeo() {
this.geo = null;
this.$emit('geo-dettached');
},
post() { post() {
this.posting = true; this.posting = true;

View file

@ -4,6 +4,7 @@
<button class="cancel" @click="cancel">%fa:times%</button> <button class="cancel" @click="cancel">%fa:times%</button>
<div> <div>
<span class="text-count" :class="{ over: text.length > 1000 }">{{ 1000 - text.length }}</span> <span class="text-count" :class="{ over: text.length > 1000 }">{{ 1000 - text.length }}</span>
<span class="geo" v-if="geo">%fa:map-marker-alt%</span>
<button class="submit" :disabled="posting" @click="post">{{ reply ? '返信' : '%i18n:mobile.tags.mk-post-form.submit%' }}</button> <button class="submit" :disabled="posting" @click="post">{{ reply ? '返信' : '%i18n:mobile.tags.mk-post-form.submit%' }}</button>
</div> </div>
</header> </header>
@ -23,7 +24,7 @@
<button class="drive" @click="chooseFileFromDrive">%fa:cloud%</button> <button class="drive" @click="chooseFileFromDrive">%fa:cloud%</button>
<button class="kao" @click="kao">%fa:R smile%</button> <button class="kao" @click="kao">%fa:R smile%</button>
<button class="poll" @click="poll = true">%fa:chart-pie%</button> <button class="poll" @click="poll = true">%fa:chart-pie%</button>
<button class="geo" @click="setGeo">%fa:map-marker-alt%</button> <button class="geo" @click="geo ? removeGeo : setGeo">%fa:map-marker-alt%</button>
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/> <input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
</div> </div>
</div> </div>
@ -99,6 +100,9 @@ export default Vue.extend({
enableHighAccuracy: true enableHighAccuracy: true
}); });
}, },
removeGeo() {
this.geo = null;
},
clear() { clear() {
this.text = ''; this.text = '';
this.files = []; this.files = [];
@ -172,10 +176,14 @@ export default Vue.extend({
position absolute position absolute
top 0 top 0
right 0 right 0
color #657786
> .text-count > .text-count
line-height 50px line-height 50px
color #657786
> .geo
margin 0 8px
line-height 50px
> .submit > .submit
margin 8px margin 8px