1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-10-31 23:31:48 +09:00

デッキのキーボードショートカットを強化

This commit is contained in:
syuilo 2018-10-20 02:49:39 +09:00
parent 41bd436d3e
commit 1fccde38f6
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
6 changed files with 72 additions and 10 deletions

View File

@ -2,7 +2,7 @@
<x-column :name="name" :column="column" :is-stacked="isStacked">
<span slot="header">%fa:envelope R%{{ name }}</span>
<x-direct/>
<x-direct @parentFocus="parentFocus"/>
</x-column>
</template>
@ -34,5 +34,15 @@ export default Vue.extend({
return '%i18n:common.deck.direct%';
}
},
methods: {
focus() {
this.$refs.tl.focus();
},
parentFocus(direction) {
this.$emit('parentFocus', direction);
},
}
});
</script>

View File

@ -1,5 +1,5 @@
<template>
<x-notes ref="timeline" :more="existMore ? more : null"/>
<x-notes ref="timeline" :more="existMore ? more : null" @parentFocus="parentFocus"/>
</template>
<script lang="ts">
@ -58,6 +58,7 @@ export default Vue.extend({
}, rej);
}));
},
more() {
this.moreFetching = true;
@ -82,12 +83,21 @@ export default Vue.extend({
return promise;
},
onNote(note) {
// Prepend a note
if (note.visibility == 'specified') {
(this.$refs.timeline as any).prepend(note);
}
}
},
focus() {
this.$refs.timeline.focus();
},
parentFocus(direction) {
this.$emit('parentFocus', direction);
},
}
});
</script>

View File

@ -1,5 +1,5 @@
<template>
<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView"/>
<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView" @parentFocus="parentFocus"/>
</template>
<script lang="ts">
@ -80,6 +80,7 @@ export default Vue.extend({
}, rej);
}));
},
more() {
this.moreFetching = true;
@ -105,12 +106,21 @@ export default Vue.extend({
return promise;
},
onNote(note) {
if (this.mediaOnly && note.files.length == 0) return;
// Prepend a note
(this.$refs.timeline as any).prepend(note);
}
},
focus() {
this.$refs.timeline.focus();
},
parentFocus(direction) {
this.$emit('parentFocus', direction);
},
}
});
</script>

View File

@ -1,5 +1,5 @@
<template>
<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView"/>
<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView" @parentFocus="parentFocus"/>
</template>
<script lang="ts">
@ -84,6 +84,7 @@ export default Vue.extend({
}, rej);
}));
},
more() {
this.moreFetching = true;
@ -109,18 +110,29 @@ export default Vue.extend({
return promise;
},
onNote(note) {
if (this.mediaOnly && note.files.length == 0) return;
// Prepend a note
(this.$refs.timeline as any).prepend(note);
},
onUserAdded() {
this.fetch();
},
onUserRemoved() {
this.fetch();
}
},
focus() {
this.$refs.timeline.focus();
},
parentFocus(direction) {
this.$emit('parentFocus', direction);
},
}
});
</script>

View File

@ -2,7 +2,7 @@
<x-column :name="name" :column="column" :is-stacked="isStacked">
<span slot="header">%fa:at%{{ name }}</span>
<x-mentions/>
<x-mentions ref="tl" @parentFocus="parentFocus"/>
</x-column>
</template>
@ -34,5 +34,15 @@ export default Vue.extend({
return '%i18n:common.deck.mentions%';
}
},
methods: {
focus() {
this.$refs.tl.focus();
},
parentFocus(direction) {
this.$emit('parentFocus', direction);
},
}
});
</script>

View File

@ -1,5 +1,5 @@
<template>
<x-notes ref="timeline" :more="existMore ? more : null"/>
<x-notes ref="timeline" :more="existMore ? more : null" @parentFocus="parentFocus"/>
</template>
<script lang="ts">
@ -57,6 +57,7 @@ export default Vue.extend({
}, rej);
}));
},
more() {
this.moreFetching = true;
@ -80,10 +81,19 @@ export default Vue.extend({
return promise;
},
onNote(note) {
// Prepend a note
(this.$refs.timeline as any).prepend(note);
}
},
focus() {
this.$refs.timeline.focus();
},
parentFocus(direction) {
this.$emit('parentFocus', direction);
},
}
});
</script>