Now can toggle the menu size (gstore.func.toggleMenuSize) @click on header icon
This commit is contained in:
parent
dc66a92169
commit
49ff17aa71
|
@ -15,6 +15,12 @@
|
|||
/* background-color: rgba(0,0,0,.7); */
|
||||
|
||||
color: #fff;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
transition: all .2s ease-in-out;
|
||||
}
|
||||
|
||||
/* Header Icon > Title */
|
||||
|
@ -137,3 +143,14 @@
|
|||
#header-notif .hnotif[data-count='0']:before{
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************/
|
||||
|
||||
/* Minified Header */
|
||||
#WRAPPER.min #HEADER #header-icon{
|
||||
width: calc( 3.5em - 3em );
|
||||
background-position: center center;
|
||||
}
|
|
@ -68,4 +68,6 @@ body{
|
|||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
transition: width .2s ease-in-out;
|
||||
}
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
cursor: pointer;
|
||||
|
||||
transition: background-color .2s ease-in-out,
|
||||
transition: background-color .1s ease-in-out,
|
||||
color .2s ease-in-out;
|
||||
}
|
||||
|
||||
|
@ -47,3 +47,14 @@
|
|||
|
||||
|
||||
/****************************/
|
||||
|
||||
/* Minified Menu */
|
||||
#WRAPPER.min #MENU{
|
||||
width: calc( 3.5em - 1px );
|
||||
}
|
||||
|
||||
|
||||
#WRAPPER.min #MENU .menu-item-wrapper .menu-item{
|
||||
background-position: center center;
|
||||
background-size: 50%;
|
||||
}
|
|
@ -33,7 +33,6 @@ new Vue({
|
|||
})
|
||||
|
||||
|
||||
|
||||
/* (3) Set WebSocket channels
|
||||
---------------------------------------------------------*/
|
||||
/* (1) Connection channel */
|
||||
|
@ -78,3 +77,5 @@ window.wsc_chat = window.wsc.channel('chat').listen(function(msg, err){
|
|||
window.gstore.data.notif[1].data = window.gstore.data.notif[1].data.concat( msg.msg );
|
||||
|
||||
}).send({name: window._SERVER.session.name});
|
||||
|
||||
|
||||
|
|
|
@ -30,3 +30,10 @@ window.gstore.add('menu_item', {
|
|||
}
|
||||
});
|
||||
window.gstore.add('menu_item_active', 'dashboard');
|
||||
window.gstore.add('min_menu', true);
|
||||
|
||||
|
||||
// Functions
|
||||
window.gstore.add('func', {
|
||||
toggleMenuSize: function(){ window.gstore.data.min_menu=!window.gstore.data.min_menu; }
|
||||
});
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
|
||||
<div id='HEADER'>
|
||||
<div id='HEADER' @click='gstore.func.toggleMenuSize'>
|
||||
|
||||
<!-- Header Icon+Title -->
|
||||
<div id='header-icon'>
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
<div v-for='(item, index) in gstore.menu_item' class='menu-item-wrapper'>
|
||||
|
||||
<div :class="(index == gstore.menu_item_active) ? 'menu-item active' : 'menu-item'" @click='navigate_menu(index)' :style='"background-image: url(/image/menu/" + item.icon + ".svg@aaaaaa"'>{{ item.label }}</div>
|
||||
<div :class="(index == gstore.menu_item_active) ? 'menu-item active' : 'menu-item'" @click='navigate_menu(index)' :style='"background-image: url(/image/menu/" + item.icon + ".svg@aaaaaa"'>
|
||||
<span v-show='!gstore.min_menu'>{{ item.label }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div id="WRAPPER">
|
||||
<div id="WRAPPER" :class='gstore.min_menu ? "min" : ""'>
|
||||
|
||||
<!-- Header -->
|
||||
<header-comp></header-comp>
|
||||
|
@ -25,7 +25,8 @@ import menu_vue from './menu.vue';
|
|||
export default {
|
||||
name: 'wrapper',
|
||||
data(){ return {
|
||||
msg: 'Main vue component'
|
||||
msg: 'Main vue component',
|
||||
gstore: window.gstore.data
|
||||
}; },
|
||||
components: {
|
||||
'HeaderComp': header_vue,
|
||||
|
|
Loading…
Reference in New Issue