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

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

View File

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

View File

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

View File

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

View File

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

View File

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