1
0
forked from mirror/misskey
This commit is contained in:
syuilo 2018-02-18 22:14:51 +09:00
parent 211b62eb92
commit 43ee5267c2
5 changed files with 19 additions and 12 deletions

View File

@ -8,7 +8,8 @@ export default function(opts) {
title: o.title, title: o.title,
placeholder: o.placeholder, placeholder: o.placeholder,
default: o.default, default: o.default,
type: o.type || 'text' type: o.type || 'text',
allowEmpty: o.allowEmpty
} }
}).$mount(); }).$mount();
d.$once('done', text => { d.$once('done', text => {

View File

@ -41,7 +41,7 @@ export default Vue.extend({
this.files = [file]; this.files = [file];
this.ok(); this.ok();
}, },
onChangeselection(files) { onChangeSelection(files) {
this.files = files; this.files = files;
}, },
upload() { upload() {

View File

@ -148,7 +148,8 @@ export default Vue.extend({
(this as any).apis.input({ (this as any).apis.input({
title: '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.rename-file%', title: '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.rename-file%',
placeholder: '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.input-new-file-name%', placeholder: '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.input-new-file-name%',
default: this.file.name default: this.file.name,
allowEmpty: false
}).then(name => { }).then(name => {
(this as any).api('drive/files/update', { (this as any).api('drive/files/update', {
file_id: this.file.id, file_id: this.file.id,

View File

@ -15,13 +15,18 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
export default Vue.extend({ export default Vue.extend({
props: ['folder', 'browser'], props: ['folder'],
data() { data() {
return { return {
hover: false, hover: false,
draghover: false draghover: false
}; };
}, },
computed: {
browser(): any {
return this.$parent;
}
},
methods: { methods: {
onClick() { onClick() {
this.browser.move(this.folder); this.browser.move(this.folder);

View File

@ -3,14 +3,13 @@
<span slot="header" :class="$style.header"> <span slot="header" :class="$style.header">
%fa:i-cursor%{{ title }} %fa:i-cursor%{{ title }}
</span> </span>
<div slot="content">
<div :class="$style.body"> <div :class="$style.body">
<input ref="text" v-model="text" :type="type" @keydown="onKeydown" :placeholder="placeholder"/> <input ref="text" v-model="text" :type="type" @keydown="onKeydown" :placeholder="placeholder"/>
</div> </div>
<div :class="$style.actions"> <div :class="$style.actions">
<button :class="$style.cancel" @click="cancel">キャンセル</button> <button :class="$style.cancel" @click="cancel">キャンセル</button>
<button :class="$style.ok" disabled="!allowEmpty && text.length == 0" @click="ok">決定</button> <button :class="$style.ok" :disabled="!allowEmpty && text.length == 0" @click="ok">決定</button>
</div>
</div> </div>
</mk-window> </mk-window>
</template> </template>
@ -44,6 +43,7 @@ export default Vue.extend({
mounted() { mounted() {
if (this.default) this.text = this.default; if (this.default) this.text = this.default;
this.$nextTick(() => { this.$nextTick(() => {
console.log(this);
(this.$refs.text as any).focus(); (this.$refs.text as any).focus();
}); });
}, },