@afeefa/vue-app 0.0.161 → 0.0.163

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.161
1
+ 0.0.163
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.161",
3
+ "version": "0.0.163",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -136,6 +136,12 @@ export default class ADialog extends Mixins(UsesPositionServiceMixin, ComponentW
136
136
  }
137
137
 
138
138
  this.$emit('update:show', this.modal)
139
+
140
+ if (!this.modal) {
141
+ setTimeout(() => { // allow client to conditionally remove <edit-modal> using v-if not before inner dialog has been removed from dom
142
+ this.$emit('destroyed')
143
+ }, 100)
144
+ }
139
145
  }
140
146
 
141
147
  setPosition () {
@@ -60,7 +60,7 @@ export default class EditForm extends Vue {
60
60
  if (this.createModelToEdit) {
61
61
  this.modelToEdit = this.createModelToEdit(this.model)
62
62
  } else if (this.model) {
63
- this.modelToEdit = this.model.cloneForEdit()
63
+ this.modelToEdit = this.model.clone()
64
64
  }
65
65
  this.lastJson = this.json
66
66
 
@@ -3,6 +3,7 @@
3
3
  :beforeClose="beforeClose"
4
4
  :show.sync="show_"
5
5
  v-bind="$attrs"
6
+ @destroyed="$emit('destroyed')"
6
7
  >
7
8
  <template #activator>
8
9
  <slot name="activator" />
@@ -34,6 +34,7 @@ export default class FlyingContextContainer extends Vue {
34
34
  visible = false
35
35
  oldOverflowY = null
36
36
  isClosing = false
37
+ lastScrollbarWidth = 0
37
38
 
38
39
  mounted () {
39
40
  const mutationWatcher = new MutationObserver(this.domChanged)
@@ -63,9 +64,8 @@ export default class FlyingContextContainer extends Vue {
63
64
  sizeChanged () {
64
65
  if (this.visible && !this.isClosing) { // do not set size if it is already closing
65
66
  this.$nextTick(() => {
66
- const scrollbarWidth = this.getScrollbarWidth()
67
67
  const el = document.documentElement
68
- const newSize = el.offsetWidth - this.$el.offsetWidth + scrollbarWidth
68
+ const newSize = el.offsetWidth - this.$el.offsetWidth + this.lastScrollbarWidth
69
69
  this.$el.style.left = newSize + 'px'
70
70
  })
71
71
  }
@@ -80,13 +80,13 @@ export default class FlyingContextContainer extends Vue {
80
80
  if (this.visible) {
81
81
  const style = getComputedStyle(el)
82
82
  this.oldOverflowY = style.overflowY
83
- const scrollbarWidth = this.getScrollbarWidth()
83
+ this.lastScrollbarWidth = this.getScrollbarWidth()
84
84
  setTimeout(() => {
85
85
  el.style.overflowY = 'hidden'
86
- el.style.marginRight = scrollbarWidth + 'px'
86
+ el.style.marginRight = this.lastScrollbarWidth + 'px'
87
87
  }, 100)
88
88
 
89
- this.$el.style.left = (el.offsetWidth - this.$el.offsetWidth + scrollbarWidth) + 'px'
89
+ this.$el.style.left = (el.offsetWidth - this.$el.offsetWidth + this.lastScrollbarWidth) + 'px'
90
90
  } else {
91
91
  el.style.overflowY = this.oldOverflowY
92
92
  el.style.marginRight = 0