A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuematerial/vue-material/commit/ef720c4 below:

Close menu while another is opened (#1266) · vuematerial/vue-material@ef720c4 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+5

-4

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+5

-4

lines changed Original file line number Diff line number Diff line change

@@ -57,7 +57,8 @@

57 57

dense: this.mdDense,

58 58

closeOnSelect: this.mdCloseOnSelect,

59 59

bodyClickObserver: null,

60 -

windowResizeObserver: null

60 +

windowResizeObserver: null,

61 +

$el: this.$el

61 62

}

62 63

}

63 64

},

@@ -105,11 +106,11 @@

105 106

},

106 107

methods: {

107 108

toggleContent ($event) {

108 -

$event.stopPropagation()

109 109

this.MdMenu.active = !this.MdMenu.active

110 110

}

111 111

},

112 112

async mounted () {

113 +

this.MdMenu.$el = this.$el

113 114

await this.$nextTick()

114 115 115 116

this.triggerEl = this.$el.querySelector('[md-menu-trigger]')

Original file line number Diff line number Diff line change

@@ -187,8 +187,8 @@

187 187

if (document) {

188 188

this.MdMenu.bodyClickObserver = new MdObserveEvent(document.body, 'click', $event => {

189 189

$event.stopPropagation()

190 - 191 -

if (!this.$el.contains($event.target)) {

190 +

let isMdMenu = this.MdMenu.$el ? this.MdMenu.$el.contains($event.target) : false

191 +

if (!this.$el.contains($event.target) && !isMdMenu) {

192 192

this.MdMenu.active = false

193 193

this.MdMenu.bodyClickObserver.destroy()

194 194

this.MdMenu.windowResizeObserver.destroy()

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4