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/c820b72 below:

adjust position when body has margin (#1551) · vuematerial/vue-material@c820b72 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+30

-16

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+30

-16

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

@@ -175,20 +175,20 @@

175 175

]

176 176

},

177 177

events: {

178 -

headings: ['Name', 'Description', 'Value'],

179 -

props: [

180 -

{

181 -

name: 'md-opened',

182 -

description: 'Triggered when menu opens',

183 -

value: 'null'

184 -

},

185 -

{

186 -

name: 'md-closed',

187 -

description: 'Triggered when menu closes',

188 -

value: 'null'

189 -

}

190 -

]

191 -

}

178 +

headings: ['Name', 'Description', 'Value'],

179 +

props: [

180 +

{

181 +

name: 'md-opened',

182 +

description: 'Triggered when menu opens',

183 +

value: 'null'

184 +

},

185 +

{

186 +

name: 'md-closed',

187 +

description: 'Triggered when menu closes',

188 +

value: 'null'

189 +

}

190 +

]

191 +

}

192 192

})

193 193

}

194 194

</script>

Original file line number Diff line number Diff line change

@@ -181,9 +181,14 @@

181 181

this.MdMenu.active = false

182 182

},

183 183

getOffsets () {

184 +

const relativePosition = this.getBodyPosition()

185 + 186 +

const offsetX = this.MdMenu.offsetX || 0

187 +

const offsetY = this.MdMenu.offsetY || 0

188 + 184 189

return {

185 -

offsetX: this.MdMenu.offsetX || 0,

186 -

offsetY: this.MdMenu.offsetY || 0

190 +

offsetX: offsetX - relativePosition.x,

191 +

offsetY: offsetY - relativePosition.y

187 192

}

188 193

},

189 194

hasCustomOffsets () {

@@ -221,6 +226,15 @@

221 226

max-width: ${this.MdMenu.instance.$el.offsetWidth}px

222 227

`

223 228

}

229 +

},

230 +

getBodyPosition() {

231 +

const body = document.body

232 +

const { top, left } = body.getBoundingClientRect()

233 + 234 +

const scrollLeft = window.pageXOffset !== undefined ? window.pageXOffset : body.scrollLeft

235 +

const scrollTop = window.pageYOffset !== undefined ? window.pageYOffset : body.scrollTop

236 + 237 +

return { x: left + scrollLeft, y: top + scrollTop }

224 238

}

225 239

},

226 240

mounted () {

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