@afeefa/vue-app 0.0.153 → 0.0.154

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.153
1
+ 0.0.154
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.153",
3
+ "version": "0.0.154",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@ import { randomCssClass } from '@a-vue/utils/random'
13
13
  import { CancelOnEscMixin } from '@a-vue/services/escape/CancelOnEscMixin'
14
14
 
15
15
  @Component({
16
- props: [{show: false}, 'beforeClose']
16
+ props: [{show: false}, 'beforeClose', 'width']
17
17
  })
18
18
  export default class FlyingContext extends Mixins(CancelOnEscMixin) {
19
19
  isVisible = false
@@ -43,7 +43,14 @@ export default class FlyingContext extends Mixins(CancelOnEscMixin) {
43
43
  }
44
44
 
45
45
  if (this.isVisible) {
46
- const container = this.getSidebarContainer()
46
+ const containerContainer = this.getFlyingContextContainer()
47
+ if (this.width) {
48
+ containerContainer.style.width = this.width
49
+ } else {
50
+ containerContainer.style.width = '50vw'
51
+ }
52
+
53
+ const container = this.getChildrenContainer()
47
54
  container.appendChild(el)
48
55
  this.coe_watchCancel() // show context -> watch esc
49
56
  } else {
@@ -53,7 +60,7 @@ export default class FlyingContext extends Mixins(CancelOnEscMixin) {
53
60
  }
54
61
 
55
62
  destroyed () {
56
- const container = this.getSidebarContainer()
63
+ const container = this.getChildrenContainer()
57
64
  const el = this.getContent()
58
65
  if (container.contains(el)) {
59
66
  container.removeChild(el)
@@ -87,7 +94,11 @@ export default class FlyingContext extends Mixins(CancelOnEscMixin) {
87
94
  return document.querySelector('.' + this.contextId)
88
95
  }
89
96
 
90
- getSidebarContainer () {
97
+ getFlyingContextContainer () {
98
+ return document.getElementById('flyingContextContainer')
99
+ }
100
+
101
+ getChildrenContainer () {
91
102
  return document.getElementById('flyingContextContainer__children')
92
103
  }
93
104
  }
@@ -56,7 +56,6 @@ export default class FlyingContextContainer extends Vue {
56
56
  return 0
57
57
  }
58
58
 
59
-
60
59
  domChanged () {
61
60
  const container = this.getChildrenContainer()
62
61
  this.visible = !!container.children.length
@@ -71,9 +70,13 @@ export default class FlyingContextContainer extends Vue {
71
70
  el.style.overflowY = 'hidden'
72
71
  el.style.marginRight = scrollbarWidth + 'px'
73
72
  }, 100)
73
+
74
+ this.$el.style.left = (el.offsetWidth - this.$el.offsetWidth + scrollbarWidth) + 'px'
74
75
  } else {
75
76
  el.style.overflowY = this.oldOverflowY
76
77
  el.style.marginRight = 0
78
+
79
+ this.$el.style.left = '101vw'
77
80
  }
78
81
  }
79
82
 
@@ -120,19 +123,20 @@ export default class FlyingContextContainer extends Vue {
120
123
  #flyingContextContainer {
121
124
  position: fixed;
122
125
  z-index: 200;
123
- right: 0;
126
+ left: 50vw;
124
127
  height: 100%;
128
+ width: 50vw;
125
129
  min-width: 400px;
126
130
  max-width: calc(100vw - 100px);
127
131
  top: 0;
128
132
  background: white;
129
- transition: right .2s;
133
+ transition: left .2s;
130
134
  padding: 2rem;
131
135
  overflow-y: auto;
132
136
  border-left: 1px solid rgba(0, 0, 0, .12);
133
137
 
134
138
  &:not(.visible) {
135
- right: -80vw;
139
+ left: 101vw;
136
140
  }
137
141
 
138
142
  .closeButton {