@afeefa/vue-app 0.0.194 → 0.0.195

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.194
1
+ 0.0.195
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.194",
3
+ "version": "0.0.195",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -2,4 +2,5 @@ import { BaseEvent } from '@a-vue/plugins/event-bus/BaseEvent'
2
2
 
3
3
  export class FlyingContextEvent extends BaseEvent {
4
4
  static HIDE_ALL = 'FlyingContextEvent:hide-all'
5
+ static START_HIDE_CONTEXT = 'FlyingContextEvent:start-hide-context'
5
6
  }
@@ -78,10 +78,14 @@ export default class FlyingContext extends Mixins(CancelOnEscMixin) {
78
78
  }
79
79
  }
80
80
 
81
- this.$el.appendChild(this.getContent())
82
- this.coe_unwatchCancel() // hide context -> do not watch esc any more
83
- this.isVisible = false
84
- this.$emit('hide')
81
+ this.$events.dispatch(new FlyingContextEvent(FlyingContextEvent.START_HIDE_CONTEXT))
82
+
83
+ setTimeout(() => { // fade in then hide contents
84
+ this.$el.appendChild(this.getContent())
85
+ this.coe_unwatchCancel() // hide context -> do not watch esc any more
86
+ this.isVisible = false
87
+ this.$emit('hide')
88
+ }, 200)
85
89
  }
86
90
  }
87
91
 
@@ -44,6 +44,8 @@ export default class FlyingContextContainer extends Vue {
44
44
 
45
45
  const sizeWatcher = new ResizeObserver(this.sizeChanged)
46
46
  sizeWatcher.observe(this.getChildrenContainer())
47
+
48
+ this.$events.on(FlyingContextEvent.START_HIDE_CONTEXT, this.onStartHideContext)
47
49
  }
48
50
 
49
51
  /**
@@ -115,18 +117,25 @@ export default class FlyingContextContainer extends Vue {
115
117
  el.style.overflowY = this.oldOverflowY
116
118
  el.style.marginRight = 0
117
119
 
118
- this.$el.style.left = '101vw' // set this if closing from outside e.g. via esc, which does not call this.hide()
120
+ this.$el.style.left = '101vw' // set this if closing from outside e.g. via context.esc, which does not call this.hide()
119
121
  }
122
+
120
123
  this.isClosing = false
121
124
  }
122
125
 
126
+ onStartHideContext () {
127
+ // context will be removed in 200ms
128
+ // we start right now and slide out the container
129
+ // so that all the contents will last until moved out of screen
130
+ this.$el.style.left = '101vw'
131
+ }
132
+
123
133
  hide () {
124
134
  if (this.visible) {
125
- this.$el.style.left = '101vw'
135
+ // ignore resize watcher while closing, prevents flickering
126
136
  this.isClosing = true
127
- setTimeout(() => { // fade in then hide contents
128
- this.$events.dispatch(new FlyingContextEvent(FlyingContextEvent.HIDE_ALL))
129
- }, 200)
137
+ // say the context that it should try to remove
138
+ this.$events.dispatch(new FlyingContextEvent(FlyingContextEvent.HIDE_ALL))
130
139
  }
131
140
  }
132
141