Small fixes in vnOrderCatalog and vnZoneEvents
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-05-08 13:23:06 +02:00
parent 6c14743017
commit b14d2f9455
10 changed files with 42 additions and 24 deletions

View File

@ -31,7 +31,7 @@ export default class Popup extends Component {
} }
/** /**
* Displays the dialog to the user. * Displays the popup.
*/ */
show() { show() {
if (this.shown) return; if (this.shown) return;
@ -74,7 +74,7 @@ export default class Popup extends Component {
} }
/** /**
* Hides the dialog calling the response handler. * Hides the popup.
*/ */
hide() { hide() {
if (!this.shown) return; if (!this.shown) return;
@ -95,6 +95,11 @@ export default class Popup extends Component {
this.emit('closeStart'); this.emit('closeStart');
} }
/**
* Called when closing transition ends and popup is not visible, it can
* be overriden by child classes (calling the super) to perform additional
* actions.
*/
onClose() { onClose() {
this.closeTimeout = null; this.closeTimeout = null;
this.popup.remove(); this.popup.remove();

View File

@ -1,6 +1,9 @@
@import "variables";
vn-scroll-up { vn-scroll-up {
top: 88px; right: 0;
right: 32px; top: $topbar-height;
margin: $float-spacing;
display: none; display: none;
position: fixed; position: fixed;
} }

View File

@ -4,6 +4,7 @@ $font-size: 12pt;
$menu-width: 256px; $menu-width: 256px;
$topbar-height: 56px; $topbar-height: 56px;
$mobile-width: 800px; $mobile-width: 800px;
$float-spacing: 20px;
// Width // Width

View File

@ -80,7 +80,7 @@ vn-layout {
padding-right: $menu-width; padding-right: $menu-width;
} }
[fixed-bottom-right] { [fixed-bottom-right] {
right: 32px + $menu-width; right: $menu-width;
} }
} }
& > .main-view { & > .main-view {
@ -94,8 +94,9 @@ vn-layout {
} }
[fixed-bottom-right] { [fixed-bottom-right] {
position: fixed; position: fixed;
bottom: 32px; bottom: 0;
right: 32px; right: 0;
margin: $float-spacing;
} }
&.ng-enter { &.ng-enter {
vn-side-menu { vn-side-menu {
@ -133,7 +134,7 @@ vn-layout {
padding-right: 0; padding-right: 0;
} }
[fixed-bottom-right] { [fixed-bottom-right] {
right: 32px; right: 0;
} }
} }
ui-view > * { ui-view > * {

View File

@ -42,13 +42,13 @@ class Controller extends Popover {
super.show(parent); super.show(parent);
} }
hide() { onClose() {
super.hide();
this.id = null; this.id = null;
this.item = {}; this.item = {};
this.tags = {}; this.tags = {};
this._prices = {}; this._prices = {};
this.total = 0; this.total = 0;
super.onClose();
} }
calculateMax() { calculateMax() {

View File

@ -1,6 +1,6 @@
@import "variables"; @import "variables";
.vn-order-prices-popover { .vn-order-prices-popover .content {
max-width: 350px; max-width: 350px;
.header > a:first-child { .header > a:first-child {

View File

@ -49,14 +49,11 @@
<div <div
ng-if="::row.type != 'day'" ng-if="::row.type != 'day'"
class="vn-mb-sm ellipsize"> class="vn-mb-sm ellipsize">
<span ng-if="row.type == 'range'">
{{::row.started | date:'dd/MM/yy'}} - {{::row.ended | date:'dd/MM/yy'}}
</span>
<span ng-if="row.type == 'indefinitely'" translate>
Indefinitely
</span>
<span ng-if="row.weekDays"> <span ng-if="row.weekDays">
({{::$ctrl.formatWdays(row.weekDays)}}) {{::$ctrl.formatWdays(row.weekDays)}}
</span>
<span ng-if="row.type == 'range'">
({{::row.started | date:'dd/MM/yy'}} - {{::row.ended | date:'dd/MM/yy'}})
</span> </span>
</div> </div>
<vn-label-value <vn-label-value
@ -91,9 +88,19 @@
</div> </div>
</vn-data-viewer> </vn-data-viewer>
</vn-side-menu> </vn-side-menu>
<a
vn-tooltip="Add event"
ng-click="$ctrl.create('weekday')"
vn-bind="+"
fixed-bottom-right>
<vn-float-button
icon="add">
</vn-float-button>
</a>
<vn-dialog <vn-dialog
vn-id="dialog" vn-id="dialog"
on-response="$ctrl.onIncludeResponse($response)"> on-response="$ctrl.onIncludeResponse($response)"
message="{{$ctrl.isNew ? 'Add event' : 'Edit event'}}">
<tpl-body> <tpl-body>
<vn-vertical> <vn-vertical>
<vn-vertical class="vn-pb-md"> <vn-vertical class="vn-pb-md">

View File

@ -41,7 +41,7 @@ class Controller extends Section {
if (events.length) if (events.length)
this.edit(events[0]); this.edit(events[0]);
else else
this.create(days, type, weekday); this.create(type, days, weekday);
} else { } else {
if (exclusions.length) if (exclusions.length)
this.exclusionDelete(exclusions); this.exclusionDelete(exclusions);
@ -62,12 +62,12 @@ class Controller extends Section {
this.$.dialog.show(); this.$.dialog.show();
} }
create(days, type, weekday) { create(type, days, weekday) {
this.isNew = true; this.isNew = true;
if (type == 'weekday') { if (type == 'weekday') {
let wdays = []; let wdays = [];
wdays[weekday] = true; if (weekday) wdays[weekday] = true;
this.selected = { this.selected = {
type: 'indefinitely', type: 'indefinitely',

View File

@ -2,3 +2,5 @@ Edit mode: Modo de edición
Include: Incluir Include: Incluir
Exclude: Excluir Exclude: Excluir
Events: Eventos Events: Eventos
Add event: Añadir evento
Edit event: Editar evento

View File

@ -66,4 +66,3 @@
vn-acl-action="remove"> vn-acl-action="remove">
</vn-float-button> </vn-float-button>
</a> </a>
<vn-scroll-up></vn-scroll-up>