1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 10:06:54 +00:00

Update Host Menu code to use a proper Vue object as reference (#404)

This commit is contained in:
Lordmau5 2018-04-08 19:42:14 +02:00 committed by Mike
parent dc358a774d
commit 4f1ebcdfbf

View file

@ -209,9 +209,9 @@ export default class HostButton extends Module {
this._current_channel_id = data.id; this._current_channel_id = data.id;
this.activeTab = this.activeTab || 'auto-host'; this.activeTab = this.activeTab || 'auto-host';
this.vueEl = new vue.Vue({ const vueEl = new vue.Vue({
el: createElement('div'), el: createElement('div'),
render: h => h('host-options', { render: h => this.vueHostMenu = h('host-options', {
hosts, hosts,
autoHostSettings, autoHostSettings,
activeTab: this.activeTab, activeTab: this.activeTab,
@ -221,7 +221,7 @@ export default class HostButton extends Module {
rearrangeHosts: event => this.rearrangeHosts(event.oldIndex, event.newIndex), rearrangeHosts: event => this.rearrangeHosts(event.oldIndex, event.newIndex),
removeFromHosts: event => this.removeUserFromHosts(event), removeFromHosts: event => this.removeUserFromHosts(event),
setActiveTab: tab => { setActiveTab: tab => {
this.vueEl.$children[0]._data.activeTab = this.activeTab = tab; this.vueHostMenu.data.activeTab = this.activeTab = tab;
}, },
updatePopper: () => { updatePopper: () => {
if (this._auto_host_tip) this._auto_host_tip.update(); if (this._auto_host_tip) this._auto_host_tip.update();
@ -241,7 +241,7 @@ export default class HostButton extends Module {
}) })
}); });
return this.vueEl.$el; return vueEl.$el;
} }
async fetchAutoHosts() { async fetchAutoHosts() {
@ -377,9 +377,9 @@ export default class HostButton extends Module {
} }
this.autoHosts = data.targets; this.autoHosts = data.targets;
if (this.vueEl) { if (this.vueHostMenu) {
this.vueEl.$children[0]._data.hosts = this.autoHosts; this.vueHostMenu.data.hosts = this.autoHosts;
this.vueEl.$children[0]._data.addedToHosts = this.currentRoomInHosts(); this.vueHostMenu.data.addedToHosts = this.currentRoomInHosts();
} }
} }
@ -413,8 +413,8 @@ export default class HostButton extends Module {
} }
this.autoHostSettings = data.settings; this.autoHostSettings = data.settings;
if (this.vueEl) { if (this.vueHostMenu) {
this.vueEl.$children[0]._data.autoHostSettings = this.autoHostSettings; this.vueHostMenu.data.autoHostSettings = this.autoHostSettings;
} }
} }
} }