@afeefa/vue-app 0.0.180 → 0.0.181

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.180
1
+ 0.0.181
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.180",
3
+ "version": "0.0.181",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -41,7 +41,8 @@ export default class InformationBar extends Vue {
41
41
  visible = false
42
42
  mobile = false
43
43
  rail = false
44
- width = 300
44
+ defaultWidth = 300
45
+ width = this.defaultWidth
45
46
 
46
47
  created () {
47
48
  this.$events.on(SidebarEvent.STATUS, ({payload: {information, informationRailed, mobile}}) => {
@@ -88,20 +89,30 @@ export default class InformationBar extends Vue {
88
89
 
89
90
  @Watch('rail')
90
91
  railChanged () {
91
- const right = `calc(-${this.width}px - 3rem + 60px)`
92
- this.$el.style.marginRight = this.rail ? right : 0
92
+ this.setRailMargin()
93
93
  }
94
94
 
95
95
  toggleRail () {
96
96
  sidebarService.setRailInformation(!this.rail)
97
97
  }
98
98
 
99
+ setRailMargin () {
100
+ if (this.rail) {
101
+ const right = `calc(-${this.width}px - 3rem + 60px)`
102
+ this.$el.style.marginRight = right
103
+ } else {
104
+ this.$el.style.marginRight = 0
105
+ }
106
+ }
107
+
99
108
  domChanged () {
100
109
  const old = this.visible
101
110
  const visible = this.hasSidebarItems()
102
111
 
103
112
  if (visible && !old) {
104
- this.width = this.getWidthFromItems()
113
+ this.width = this.getWidthFromItems() || this.defaultWidth
114
+ this.setRailMargin()
115
+
105
116
  sidebarService.setInformation(true)
106
117
  }
107
118