@afeefa/vue-app 0.0.154 → 0.0.155
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.155
|
package/package.json
CHANGED
@@ -47,7 +47,7 @@ export default class FlyingContext extends Mixins(CancelOnEscMixin) {
|
|
47
47
|
if (this.width) {
|
48
48
|
containerContainer.style.width = this.width
|
49
49
|
} else {
|
50
|
-
containerContainer.style.width = '
|
50
|
+
containerContainer.style.width = 'auto'
|
51
51
|
}
|
52
52
|
|
53
53
|
const container = this.getChildrenContainer()
|
@@ -35,10 +35,13 @@ export default class FlyingContextContainer extends Vue {
|
|
35
35
|
oldOverflowY = null
|
36
36
|
|
37
37
|
mounted () {
|
38
|
-
|
39
|
-
|
38
|
+
const mutationWatcher = new MutationObserver(this.domChanged)
|
39
|
+
mutationWatcher.observe(this.getChildrenContainer(), { childList: true })
|
40
40
|
|
41
41
|
window.addEventListener('mousedown', this.onClickOutside)
|
42
|
+
|
43
|
+
const sizeWatcher = new ResizeObserver(this.sizeChanged)
|
44
|
+
sizeWatcher.observe(this.getChildrenContainer())
|
42
45
|
}
|
43
46
|
|
44
47
|
getScrollbarWidth () {
|
@@ -56,6 +59,18 @@ export default class FlyingContextContainer extends Vue {
|
|
56
59
|
return 0
|
57
60
|
}
|
58
61
|
|
62
|
+
|
63
|
+
sizeChanged () {
|
64
|
+
if (this.visible) {
|
65
|
+
this.$nextTick(() => {
|
66
|
+
const scrollbarWidth = this.getScrollbarWidth()
|
67
|
+
const el = document.documentElement
|
68
|
+
const newSize = el.offsetWidth - this.$el.offsetWidth + scrollbarWidth
|
69
|
+
this.$el.style.left = newSize + 'px'
|
70
|
+
})
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
59
74
|
domChanged () {
|
60
75
|
const container = this.getChildrenContainer()
|
61
76
|
this.visible = !!container.children.length
|
@@ -75,14 +90,15 @@ export default class FlyingContextContainer extends Vue {
|
|
75
90
|
} else {
|
76
91
|
el.style.overflowY = this.oldOverflowY
|
77
92
|
el.style.marginRight = 0
|
78
|
-
|
79
|
-
this.$el.style.left = '101vw'
|
80
93
|
}
|
81
94
|
}
|
82
95
|
|
83
96
|
hide () {
|
84
97
|
if (this.visible) {
|
85
|
-
this.$
|
98
|
+
this.$el.style.left = '101vw'
|
99
|
+
setTimeout(() => { // fade in then hide contents
|
100
|
+
this.$events.dispatch(new FlyingContextEvent(FlyingContextEvent.HIDE_ALL))
|
101
|
+
}, 200)
|
86
102
|
}
|
87
103
|
}
|
88
104
|
|
@@ -123,9 +139,8 @@ export default class FlyingContextContainer extends Vue {
|
|
123
139
|
#flyingContextContainer {
|
124
140
|
position: fixed;
|
125
141
|
z-index: 200;
|
126
|
-
left: 50vw;
|
127
142
|
height: 100%;
|
128
|
-
width:
|
143
|
+
width: auto;
|
129
144
|
min-width: 400px;
|
130
145
|
max-width: calc(100vw - 100px);
|
131
146
|
top: 0;
|