mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2026-01-02 07:36:15 +00:00
Using document.body.clientWidth instead of window.innerWidth (#58) + rebuild
This commit is contained in:
4
dist/index.js
vendored
4
dist/index.js
vendored
File diff suppressed because one or more lines are too long
4
dist/ssr.index.js
vendored
4
dist/ssr.index.js
vendored
File diff suppressed because one or more lines are too long
@@ -114,7 +114,7 @@
|
|||||||
return (height.type === '%' || height.type === 'px')
|
return (height.type === '%' || height.type === 'px')
|
||||||
&& height.value > 0
|
&& height.value > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return value >= 0
|
return value >= 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
this.onWindowResize()
|
this.onWindowResize()
|
||||||
|
|
||||||
if (this.scrollable && !this.isAutoHeight) {
|
if (this.scrollable && !this.isAutoHeight) {
|
||||||
console.warn(`Modal "${this.name}" has scrollable flag set to true ` +
|
console.warn(`Modal "${this.name}" has scrollable flag set to true ` +
|
||||||
`but height is not "auto" (${this.height})`)
|
`but height is not "auto" (${this.height})`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -251,8 +251,8 @@
|
|||||||
trueModalHeight () {
|
trueModalHeight () {
|
||||||
const { window, modal, isAutoHeight, adaptive } = this
|
const { window, modal, isAutoHeight, adaptive } = this
|
||||||
|
|
||||||
const value = (modal.heightType === '%')
|
const value = (modal.heightType === '%')
|
||||||
? window.height / 100 * modal.height
|
? window.height / 100 * modal.height
|
||||||
: modal.height
|
: modal.height
|
||||||
|
|
||||||
if (isAutoHeight) {
|
if (isAutoHeight) {
|
||||||
@@ -299,7 +299,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onWindowResize () {
|
onWindowResize () {
|
||||||
this.window.width = window.innerWidth
|
this.window.width = document.body.clientWidth
|
||||||
this.window.height = window.innerHeight
|
this.window.height = window.innerHeight
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -334,12 +334,12 @@
|
|||||||
toggle (state, params) {
|
toggle (state, params) {
|
||||||
const { reset, visible } = this
|
const { reset, visible } = this
|
||||||
|
|
||||||
const beforeEventName = visible
|
const beforeEventName = visible
|
||||||
? 'before-close'
|
? 'before-close'
|
||||||
: 'before-open'
|
: 'before-open'
|
||||||
|
|
||||||
const afterEventName = visible
|
const afterEventName = visible
|
||||||
? 'closed'
|
? 'closed'
|
||||||
: 'opened'
|
: 'opened'
|
||||||
|
|
||||||
if (beforeEventName === 'before-open' && reset) {
|
if (beforeEventName === 'before-open' && reset) {
|
||||||
|
|||||||
Reference in New Issue
Block a user