@afeefa/vue-app 0.0.151 → 0.0.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.153
|
package/package.json
CHANGED
@@ -67,6 +67,10 @@ export default class EditForm extends Vue {
|
|
67
67
|
this.$emit('update:modelToEdit', this.modelToEdit)
|
68
68
|
}
|
69
69
|
|
70
|
+
resetChanged () {
|
71
|
+
this.lastJson = this.json
|
72
|
+
}
|
73
|
+
|
70
74
|
/**
|
71
75
|
* This will be triggered after the this.model has been set
|
72
76
|
* but before sub components may have changed model values
|
@@ -32,6 +32,7 @@ import { getZIndex } from 'vuetify/lib/util/helpers'
|
|
32
32
|
})
|
33
33
|
export default class FlyingContextContainer extends Vue {
|
34
34
|
visible = false
|
35
|
+
oldOverflowY = null
|
35
36
|
|
36
37
|
mounted () {
|
37
38
|
this.mutationWatcher = new MutationObserver(this.domChanged)
|
@@ -40,14 +41,39 @@ export default class FlyingContextContainer extends Vue {
|
|
40
41
|
window.addEventListener('mousedown', this.onClickOutside)
|
41
42
|
}
|
42
43
|
|
44
|
+
getScrollbarWidth () {
|
45
|
+
const el = document.documentElement
|
46
|
+
const overflowY = getComputedStyle(el)['overflow-y']
|
47
|
+
if (overflowY === 'scroll' || (overflowY === 'auto' && el.scrollHeight > el.clientHeight)) {
|
48
|
+
// measure scrollbar width https://stackoverflow.com/a/55278118
|
49
|
+
const scrollbox = document.createElement('div')
|
50
|
+
scrollbox.style.overflow = 'scroll'
|
51
|
+
document.body.appendChild(scrollbox)
|
52
|
+
const scrollBarWidth = scrollbox.offsetWidth - scrollbox.clientWidth
|
53
|
+
document.body.removeChild(scrollbox)
|
54
|
+
return scrollBarWidth
|
55
|
+
}
|
56
|
+
return 0
|
57
|
+
}
|
58
|
+
|
59
|
+
|
43
60
|
domChanged () {
|
44
61
|
const container = this.getChildrenContainer()
|
45
62
|
this.visible = !!container.children.length
|
46
63
|
|
64
|
+
const el = document.documentElement
|
65
|
+
|
47
66
|
if (this.visible) {
|
48
|
-
|
67
|
+
const style = getComputedStyle(el)
|
68
|
+
this.oldOverflowY = style.overflowY
|
69
|
+
const scrollbarWidth = this.getScrollbarWidth()
|
70
|
+
setTimeout(() => {
|
71
|
+
el.style.overflowY = 'hidden'
|
72
|
+
el.style.marginRight = scrollbarWidth + 'px'
|
73
|
+
}, 100)
|
49
74
|
} else {
|
50
|
-
|
75
|
+
el.style.overflowY = this.oldOverflowY
|
76
|
+
el.style.marginRight = 0
|
51
77
|
}
|
52
78
|
}
|
53
79
|
|