|
@@ -1,6 +1,11 @@
|
|
<template>
|
|
<template>
|
|
<div class="side-navigation"
|
|
<div class="side-navigation"
|
|
- :class="{ wide: window.wide, narrow: !window.wide, active: window.menu }">
|
|
|
|
|
|
+ :class="{
|
|
|
|
+ wide: window.wide,
|
|
|
|
+ narrow: !window.wide,
|
|
|
|
+ active: window.menu ,
|
|
|
|
+ collapsed: collapsed
|
|
|
|
+ }">
|
|
<!-- project settings -->
|
|
<!-- project settings -->
|
|
<div class="item"
|
|
<div class="item"
|
|
:class="{active: window.content === 'settings', inactive: !projectPath}"
|
|
:class="{active: window.content === 'settings', inactive: !projectPath}"
|
|
@@ -13,13 +18,27 @@
|
|
@click="close">
|
|
@click="close">
|
|
Close
|
|
Close
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <div v-if="window.wide"
|
|
|
|
+ class="item"
|
|
|
|
+ @click="collapse">
|
|
|
|
+ Collapse
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
name: "side-navigation-bar",
|
|
name: "side-navigation-bar",
|
|
- props: ['window', 'socket', 'projectPath'],
|
|
|
|
|
|
+ props: ['window', 'socket', 'status', 'projectPath'],
|
|
|
|
+ computed: {
|
|
|
|
+ collapsed: function() {
|
|
|
|
+ if (!this.status)
|
|
|
|
+ return false;
|
|
|
|
+
|
|
|
|
+ return this.status.settings.frontend.collapse;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
ifProjectIsOpened: function(fun, ...args) {
|
|
ifProjectIsOpened: function(fun, ...args) {
|
|
if (this.projectPath)
|
|
if (this.projectPath)
|
|
@@ -27,10 +46,16 @@ export default {
|
|
},
|
|
},
|
|
show: function(value) {
|
|
show: function(value) {
|
|
this.window.content = value;
|
|
this.window.content = value;
|
|
|
|
+ this.$emit('close', null);
|
|
},
|
|
},
|
|
close: function() {
|
|
close: function() {
|
|
- if (this.projectPath)
|
|
|
|
|
|
+ if (this.projectPath) {
|
|
this.socket.set(this.projectPath + '/status', 'save');
|
|
this.socket.set(this.projectPath + '/status', 'save');
|
|
|
|
+ this.$emit('close', null);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ collapse: function() {
|
|
|
|
+ this.socket.set('settings/frontend/collapse', !this.collapsed);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -61,11 +86,15 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.side-navigation .item {
|
|
.side-navigation .item {
|
|
- padding: 1rem 3rem 1rem 1rem;
|
|
|
|
|
|
+ padding: 1rem 4rem 1rem 1rem;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.side-navigation.wide.collapsed .item {
|
|
|
|
+ width: 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
.side-navigation .item:hover:not(.inactive) {
|
|
.side-navigation .item:hover:not(.inactive) {
|
|
background-color: #292929;
|
|
background-color: #292929;
|
|
}
|
|
}
|