Loading client/src/components/Masthead/MastheadItem.vue +4 −10 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ </template> </b-nav-item> <b-nav-item-dropdown @blur="hideDropdown" ref="dropdown" v-else :class="classes" Loading Loading @@ -111,20 +112,13 @@ export default { return document.getElementById("galaxy_main"); }, }, updated() { if (this.$refs.dropdown && this.galaxyIframe) { this.galaxyIframe.addEventListener("load", this.iframeListener); } mounted() { window.addEventListener("blur", () => this.hideDropdown()); }, destroyed() { if (this.$refs.dropdown && this.galaxyIframe) { this.galaxyIframe.removeEventListener("load", this.iframeListener); } window.removeEventListener("blur", () => this.hideDropdown()); }, methods: { iframeListener() { return this.galaxyIframe.contentDocument.addEventListener("click", this.hideDropdown); }, hideDropdown() { if (this.$refs.dropdown) this.$refs.dropdown.hide(); }, Loading Loading
client/src/components/Masthead/MastheadItem.vue +4 −10 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ </template> </b-nav-item> <b-nav-item-dropdown @blur="hideDropdown" ref="dropdown" v-else :class="classes" Loading Loading @@ -111,20 +112,13 @@ export default { return document.getElementById("galaxy_main"); }, }, updated() { if (this.$refs.dropdown && this.galaxyIframe) { this.galaxyIframe.addEventListener("load", this.iframeListener); } mounted() { window.addEventListener("blur", () => this.hideDropdown()); }, destroyed() { if (this.$refs.dropdown && this.galaxyIframe) { this.galaxyIframe.removeEventListener("load", this.iframeListener); } window.removeEventListener("blur", () => this.hideDropdown()); }, methods: { iframeListener() { return this.galaxyIframe.contentDocument.addEventListener("click", this.hideDropdown); }, hideDropdown() { if (this.$refs.dropdown) this.$refs.dropdown.hide(); }, Loading