Using document.body.clientWidth instead of window.innerWidth (#58) + rebuild

This commit is contained in:
euvl
2017-08-07 12:46:14 +01:00
parent 0ea9d797cd
commit c81801ceb5
3 changed files with 14 additions and 14 deletions

4
dist/index.js vendored

File diff suppressed because one or more lines are too long

4
dist/ssr.index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -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) {