Left menu fixed

This commit is contained in:
Juan Ferrer 2019-01-20 18:48:03 +01:00
parent 2df9579f2c
commit 6e43b11e16
44 changed files with 128 additions and 194 deletions

View File

@ -64,7 +64,7 @@ let actions = {
},
selectModule: function(moduleName, done) {
this.waitToClick(`body > vn-app > vn-vertical > vn-vertical > vn-home > div > div > a[ui-sref="${moduleName}.index"]`)
this.waitToClick(`vn-home a[ui-sref="${moduleName}.index"]`)
.waitForURL(moduleName)
.then(done)
.catch(done);

View File

@ -104,7 +104,7 @@ export default {
phoneInput: `${components.vnTextfield}[name="phone"]`,
mobileInput: `${components.vnTextfield}[name="mobile"]`,
defaultAddress: 'vn-client-address-index vn-horizontal:nth-child(2) div[name="street"]',
secondMakeDefaultStar: 'vn-client-address-index > vn-vertical > vn-card > div > vn-horizontal:nth-child(3) vn-icon-button[icon="star_border"]',
secondMakeDefaultStar: 'vn-client-address-index vn-card vn-horizontal:nth-child(3) vn-icon-button[icon="star_border"]',
firstEditButton: `vn-client-address-index vn-icon-button[icon='edit']`,
secondEditButton: `vn-client-address-index vn-horizontal:nth-child(3) vn-icon-button[icon='edit']`,
activeCheckbox: `vn-check[label='Enabled'] > label > input`,
@ -282,7 +282,7 @@ export default {
firstSaleDiscount: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(6)'
},
ticketsIndex: {
newTicketButton: 'body > vn-app > vn-vertical > vn-vertical > ui-view > vn-ticket-index > a',
newTicketButton: 'vn-ticket-index > a',
searchResult: `vn-ticket-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr`,
searchResultDate: `vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)`,
searchResultAddress: `vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)`,

View File

@ -82,9 +82,6 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="$ctrl.model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="$ctrl.model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -23,7 +23,7 @@ class Pagination extends Component {
$onInit() {
if (!this._scrollElement)
this.scrollElement = document.body;
this.scrollElement = window;
}
set scrollSelector(value) {
@ -50,9 +50,24 @@ class Pagination extends Component {
}
onScroll() {
let scrollInfo;
let scrollElement = this.scrollElement;
let shouldLoad =
scrollElement.scrollTop + scrollElement.clientHeight >= (scrollElement.scrollHeight - this.scrollOffset)
if (scrollElement == window) {
scrollInfo = {
top: window.pageYOffset,
height: window.innerHeight,
position: window.document.body.scrollHeight
};
} else {
scrollInfo = {
top: scrollElement.scrollTop,
height: scrollElement.clientHeight,
position: scrollElement.scrollHeight
};
}
let shouldLoad = scrollInfo.top + scrollInfo.height >= (scrollInfo.position - this.scrollOffset)
&& !this.model.isLoading
&& (this.maxLoads <= 0 || this.nLoads < this.maxLoads);

View File

@ -1,13 +1,11 @@
<vn-vertical full-height class="bg-content">
<vn-topbar vn-auto>
<a ui-sref="home" title="{{'Home' | translate}}">
<img class="logo" src="./logo.svg" alt="Logo"></img>
</a>
<vn-spinner enable="$ctrl.vnApp.loading"></vn-spinner>
<vn-main-menu></vn-main-menu>
</vn-topbar>
<vn-vertical vn-one ui-view scrollable class="main-view">
<vn-home></vn-home>
</vn-vertical>
<vn-snackbar vn-id="snackbar"></vn-snackbar>
</vn-vertical>
<vn-topbar vn-auto>
<a ui-sref="home" title="{{'Home' | translate}}">
<img class="logo" src="./logo.svg" alt="Logo"></img>
</a>
<vn-spinner enable="$ctrl.vnApp.loading"></vn-spinner>
<vn-main-menu></vn-main-menu>
</vn-topbar>
<div ui-view class="main-view">
<vn-home></vn-home>
</div>
<vn-snackbar vn-id="snackbar"></vn-snackbar>

View File

@ -1,12 +1,20 @@
body {
height: 100%;
}
@import "background";
body {
@extend .bg-content;
overflow: auto;
}
vn-app {
display: block;
height: 100%;
vn-topbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1;
box-shadow: 0 .1em .2em rgba(1, 1, 1, .2);
.logo {
float: left;
height: 1.8em;
@ -18,9 +26,6 @@ vn-app {
}
}
.main-view {
& > * {
height: 100%;
overflow: auto;
}
padding-top: 4em;
}
}

View File

@ -1,25 +1,18 @@
<vn-card ng-if="::$ctrl.items.length > 0">
<vn-vertical pad-medium-top pad-medium-bottom>
<vn-horizontal>
<ul>
<li ng-repeat="item in ::$ctrl.items" name="{{::item.description}}">
<a ui-sref="{{::item.state}}" ng-class="{active: item.childs.length == 0 && item.active, expanded: item.active, collapsed: !item.active}"
ng-click="$ctrl.setActive(item)">
<vn-icon icon="{{::item.icon}}" ng-if="::item.icon"></vn-icon>
<vn-icon icon="keyboard_arrow_down" ng-if="::item.childs.length > 0"></vn-icon>
<span translate>{{::item.description}}</span>
</a>
<ul ng-show="item.childs.length > 0 && item.active">
<li ng-repeat="child in ::item.childs">
<a ui-sref="{{::child.state}}" ng-class="{active: child.active}">
<vn-icon icon="{{::child.icon}}"></vn-icon>
<span translate>{{::child.description}}</span>
</a>
</li>
</ul>
</li>
</ul>
</vn-horizontal>
</vn-vertical>
</vn-card>
<ul ng-if="::$ctrl.items.length > 0" pad-medium-v>
<li ng-repeat="item in ::$ctrl.items" name="{{::item.description}}">
<a ui-sref="{{::item.state}}" ng-class="{active: item.childs.length == 0 && item.active, expanded: item.active, collapsed: !item.active}"
ng-click="$ctrl.setActive(item)">
<vn-icon icon="{{::item.icon}}" ng-if="::item.icon"></vn-icon>
<vn-icon icon="keyboard_arrow_down" ng-if="::item.childs.length > 0"></vn-icon>
<span translate>{{::item.description}}</span>
</a>
<ul ng-show="item.childs.length > 0 && item.active">
<li ng-repeat="child in ::item.childs">
<a ui-sref="{{::child.state}}" ng-class="{active: child.active}">
<vn-icon icon="{{::child.icon}}"></vn-icon>
<span translate>{{::child.description}}</span>
</a>
</li>
</ul>
</li>
</ul>

View File

@ -162,18 +162,24 @@ vn-tool-bar {
}
vn-main-block {
display:block;
max-width: 1920px;
width:100%;
display: block;
margin: 0 auto;
.left-block {
position: fixed;
z-index: 1;
top: 4em;
left: 0;
bottom: 0;
width: 16em;
min-width: 16em;
padding-left: 1em;
padding-bottom: 1em;
background-color: white;
box-shadow: 0 .1em .2em rgba(1, 1, 1, .2);
overflow: auto;
}
& > vn-horizontal > vn-one > [ui-view] {
padding-left: 16em;
}
.right-block {
width: 16em;
min-width: 16em;

View File

@ -1,6 +1,6 @@
<vn-main-block>
<vn-vertical margin-medium>
<vn-zone-descriptor zone="$ctrl.zone"></vn-zone-descriptor>
<vn-zone-descriptor zone="$ctrl.zone"></vn-zone-descriptor>
<vn-horizontal>
<vn-one ui-view></vn-one>
<vn-auto class="right-block">

View File

@ -1,4 +1,4 @@
<vn-card margin-medium-v class="vn-descriptor">
<vn-card class="vn-descriptor">
<vn-horizontal class="header">
<a translate-attr="{title: 'Return to module index'}" ui-sref="zone.index">
<vn-icon icon="chevron_left"></vn-icon>

View File

@ -52,10 +52,7 @@
</vn-empty-rows>
</vn-table>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
<a ui-sref="zone.create" vn-tooltip="New zone" vn-bind="+" fixed-bottom-right>

View File

@ -1,4 +1,4 @@
<vn-card margin-medium-v class="vn-descriptor">
<vn-card class="vn-descriptor">
<vn-horizontal class="header">
<a translate-attr="{title: 'Return to module index'}" ui-sref="claim.index">
<vn-icon icon="chevron_left"></vn-icon>

View File

@ -61,10 +61,7 @@
</vn-empty-rows>
</vn-table>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
<vn-client-descriptor-popover vn-id="descriptor"></vn-client-descriptor-popover>
<vn-dialog class="dialog-summary"

View File

@ -6,8 +6,8 @@
data="addresses"
auto-load="true">
</vn-crud-model>
<vn-vertical>
<vn-card pad-large compact>
<div compact>
<vn-card pad-large>
<vn-title vn-one>Addresses</vn-title>
<vn-horizontal ng-repeat="address in addresses" class="pad-medium-top" style="align-items: center;">
<vn-one border-radius class="pad-small border-solid"
@ -67,4 +67,4 @@
icon="add"
label="Add">
</vn-float-button>
</vn-vertical>
</div>

View File

@ -1,5 +1,5 @@
<vn-vertical>
<vn-card pad-large compact>
<div compact>
<vn-card pad-large>
<vn-title vn-one>Contract credit insurance</vn-title>
<vn-horizontal ng-repeat="classification in $ctrl.classifications track by classification.id" class="pad-medium-top" style="align-items: center;">
<vn-one border-radius class="pad-small border-solid" ng-class="{'bg-main': !classification.finished,'bg-opacity-item': classification.finished}">
@ -55,7 +55,7 @@
vn-bind="+"
label="Add">
</vn-float-button>
</vn-vertical>
</div>
<vn-confirm
vn-id="close-contract"
on-response="$ctrl.returnDialog(response)"

View File

@ -30,10 +30,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
<vn-button-bar>
<button

View File

@ -31,10 +31,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -1,4 +1,4 @@
<vn-card margin-medium-v class="vn-descriptor">
<vn-card class="vn-descriptor">
<vn-horizontal class="header">
<a translate-attr="{title: 'Return to module index'}" ui-sref="client.index">
<vn-icon icon="chevron_left"></vn-icon>

View File

@ -45,10 +45,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -6,7 +6,6 @@
data="clients"
auto-load="false">
</vn-crud-model>
<div margin-medium>
<div class="vn-list">
<vn-card pad-medium-h>
@ -31,10 +30,7 @@
Enter a new search
</vn-empty-rows>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
</div>
<a ui-sref="client.create" vn-tooltip="New client" vn-bind="+" fixed-bottom-right>

View File

@ -35,9 +35,6 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -43,10 +43,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -91,10 +91,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<a ui-sref="client.card.risk.create"

View File

@ -35,10 +35,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<a ui-sref="client.card.sample.create" vn-tooltip="Send sample"

View File

@ -54,9 +54,6 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -1,10 +1,7 @@
<vn-main-block>
<vn-horizontal>
<vn-auto class="left-block">
<vn-item-descriptor
margin-medium-v
item="$ctrl.item">
</vn-item-descriptor>
<vn-item-descriptor item="$ctrl.item"></vn-item-descriptor>
<vn-left-menu></vn-left-menu>
</vn-auto>
<vn-one>

View File

@ -33,9 +33,6 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -31,10 +31,7 @@
Enter a new search
</vn-empty-rows>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
</div>
<a ui-sref="item.create" vn-tooltip="New item" vn-bind="+" fixed-bottom-right>

View File

@ -68,9 +68,6 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -1,4 +1,4 @@
<vn-card margin-medium-v class="vn-descriptor">
<vn-card class="vn-descriptor">
<vn-horizontal class="header">
<a translate-attr="{title: 'Return to module index'}" ui-sref="ticket.index">
<vn-icon icon="chevron_left"></vn-icon>

View File

@ -96,10 +96,7 @@
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-pagination margin-small-v
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination margin-small-v model="model"></vn-pagination>
</vn-vertical>
<vn-auto class="right-block">

View File

@ -1,4 +1,4 @@
<vn-card margin-medium-v class="vn-descriptor">
<vn-card class="vn-descriptor">
<vn-horizontal class="header">
<a translate-attr="{title: 'Return to module index'}" ui-sref="order.index">
<vn-icon icon="chevron_left"></vn-icon>

View File

@ -64,10 +64,7 @@
</vn-empty-rows>
</vn-table>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
<a ui-sref="order.create" vn-bind="+" vn-tooltip="New order" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -49,10 +49,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<vn-item-descriptor-popover vn-id="descriptor"></vn-item-descriptor-popover>

View File

@ -1,12 +1,14 @@
<vn-button-bar>
<vn-step-control
step-count="10"
steps="[
{name: 'Basic data', state: 'ticket.card.data.stepOne'},
{name: 'Price difference', state: 'ticket.card.data.stepTwo'},
{name: 'Charge', state: 'ticket.card.data.stepThree'}]"
on-step-change="$ctrl.onStepChange(state)"
on-step-end="$ctrl.onSubmit()">
</vn-step-control>
</vn-button-bar>
<ui-view></ui-view>
<vn-step-control
step-count="10"
steps="[
{name: 'Basic data', state: 'ticket.card.data.stepOne'},
{name: 'Price difference', state: 'ticket.card.data.stepTwo'},
{name: 'Charge', state: 'ticket.card.data.stepThree'}]"
on-step-change="$ctrl.onStepChange(state)"
on-step-end="$ctrl.onSubmit()">
</vn-step-control>
</vn-button-bar>
<div compact>
<ui-view></ui-view>
</div>

View File

@ -51,10 +51,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>

View File

@ -95,10 +95,7 @@
</vn-empty-rows>
</vn-table>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
<a ui-sref="ticket.create" vn-tooltip="New ticket" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -68,10 +68,7 @@
</vn-one>
</vn-horizontal>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<vn-item-descriptor-popover vn-id="descriptor"></vn-item-descriptor-popover>

View File

@ -43,10 +43,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<vn-item-descriptor-popover vn-id="descriptor"

View File

@ -54,10 +54,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<vn-item-descriptor-popover vn-id="descriptor"

View File

@ -31,10 +31,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<a ui-sref="ticket.card.tracking.edit" vn-bind="+" vn-visible-by="production, administrative" fixed-bottom-right>

View File

@ -49,10 +49,7 @@
</vn-empty-rows>
</vn-table>
</vn-vertical>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<vn-item-descriptor-popover vn-id="descriptor"

View File

@ -61,10 +61,7 @@
</vn-empty-rows>
</vn-table>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>
</form>
<vn-client-descriptor-popover vn-id="clientDescriptor"></vn-client-descriptor-popover>

View File

@ -52,8 +52,5 @@
</vn-empty-rows>
</vn-table>
</vn-card>
<vn-pagination
model="model"
scroll-selector="ui-view">
</vn-pagination>
<vn-pagination model="model"></vn-pagination>
</div>