@afeefa/vue-app 0.0.154 → 0.0.156

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.154
1
+ 0.0.156
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.154",
3
+ "version": "0.0.156",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -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 = '50vw'
50
+ containerContainer.style.width = 'auto'
51
51
  }
52
52
 
53
53
  const container = this.getChildrenContainer()
@@ -33,12 +33,16 @@ import { getZIndex } from 'vuetify/lib/util/helpers'
33
33
  export default class FlyingContextContainer extends Vue {
34
34
  visible = false
35
35
  oldOverflowY = null
36
+ isClosing = false
36
37
 
37
38
  mounted () {
38
- this.mutationWatcher = new MutationObserver(this.domChanged)
39
- this.mutationWatcher.observe(this.getChildrenContainer(), { childList: true })
39
+ const mutationWatcher = new MutationObserver(this.domChanged)
40
+ mutationWatcher.observe(this.getChildrenContainer(), { childList: true })
40
41
 
41
42
  window.addEventListener('mousedown', this.onClickOutside)
43
+
44
+ const sizeWatcher = new ResizeObserver(this.sizeChanged)
45
+ sizeWatcher.observe(this.getChildrenContainer())
42
46
  }
43
47
 
44
48
  getScrollbarWidth () {
@@ -56,6 +60,17 @@ export default class FlyingContextContainer extends Vue {
56
60
  return 0
57
61
  }
58
62
 
63
+ sizeChanged () {
64
+ if (this.visible && !this.isClosing) { // do not set size if it is already closing
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,17 @@ 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
  }
94
+ this.isClosing = false
81
95
  }
82
96
 
83
97
  hide () {
84
98
  if (this.visible) {
85
- this.$events.dispatch(new FlyingContextEvent(FlyingContextEvent.HIDE_ALL))
99
+ this.$el.style.left = '101vw'
100
+ this.isClosing = true
101
+ setTimeout(() => { // fade in then hide contents
102
+ this.$events.dispatch(new FlyingContextEvent(FlyingContextEvent.HIDE_ALL))
103
+ }, 200)
86
104
  }
87
105
  }
88
106
 
@@ -123,9 +141,8 @@ export default class FlyingContextContainer extends Vue {
123
141
  #flyingContextContainer {
124
142
  position: fixed;
125
143
  z-index: 200;
126
- left: 50vw;
127
144
  height: 100%;
128
- width: 50vw;
145
+ width: auto;
129
146
  min-width: 400px;
130
147
  max-width: calc(100vw - 100px);
131
148
  top: 0;