Automatically select the right channel in the select
This commit is contained in:
parent
0530394990
commit
89d3e1d21a
|
|
@ -18,6 +18,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="channels">
|
||||||
|
<div class="select">
|
||||||
|
<select class="select" v-model="channel">
|
||||||
|
<option :value="ch" v-text="ch.name" :key="ch.uid" v-for="ch in channels"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="results">
|
<div class="results">
|
||||||
<feed-chooser :feed="feed" @showFeed="showFeed(feed)" @addFeed="addFeed(feed)" v-for="(feed, i) in feeds" :key="i"/>
|
<feed-chooser :feed="feed" @showFeed="showFeed(feed)" @addFeed="addFeed(feed)" v-for="(feed, i) in feeds" :key="i"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -38,10 +46,11 @@
|
||||||
export default {
|
export default {
|
||||||
name: "FeedFollower",
|
name: "FeedFollower",
|
||||||
components: {FeedChooser, Timeline},
|
components: {FeedChooser, Timeline},
|
||||||
props: ['isOpen', 'channel', 'initialQuery'],
|
props: ['isOpen', 'initialChannel', 'initialQuery'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
channel: {},
|
||||||
feeds: [],
|
feeds: [],
|
||||||
timeline: {items: [], paging: {}},
|
timeline: {items: [], paging: {}},
|
||||||
query: '',
|
query: '',
|
||||||
|
|
@ -55,6 +64,9 @@
|
||||||
},
|
},
|
||||||
searchClasses() {
|
searchClasses() {
|
||||||
return {'button': true, 'is-primary': true, 'is-loading': this.loading}
|
return {'button': true, 'is-primary': true, 'is-loading': this.loading}
|
||||||
|
},
|
||||||
|
channels() {
|
||||||
|
return this.$store.state.channels
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -63,6 +75,7 @@
|
||||||
isOpen(newVal, oldVal) {
|
isOpen(newVal, oldVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.query = this.initialQuery
|
this.query = this.initialQuery
|
||||||
|
this.channel = this.initialChannel
|
||||||
|
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
this.$refs.query.focus()
|
this.$refs.query.focus()
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<div class="column"></div>
|
<div class="column"></div>
|
||||||
|
|
||||||
<channel-creator :is-open="this.$store.state.channelCreatorIsOpen"></channel-creator>
|
<channel-creator :is-open="this.$store.state.channelCreatorIsOpen"></channel-creator>
|
||||||
<feed-follower :is-open="feedFollowerIsOpen" @close="closeFeedFollower" :channel="channel" :initial-query="feedFollowerQuery"></feed-follower>
|
<feed-follower :is-open="feedFollowerIsOpen" @close="closeFeedFollower" :initial-channel="channel" :initial-query="feedFollowerQuery"></feed-follower>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user