Destroy edit prop fix
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-06-29 09:38:42 +02:00
parent beb1dd4973
commit 789769ad7d
3 changed files with 11 additions and 11 deletions

View File

@ -213,9 +213,8 @@
<!-- Price Popover --> <!-- Price Popover -->
<vn-popover <vn-popover
vn-id="edit-price-popover" vn-id="edit-price-popover"
on-open="$ctrl.getMana()" on-open="$ctrl.getMana()">
on-close="$ctrl.edit = null"> <div class="edit-popover">
<div class="edit-price">
<vn-spinner class="vn-pa-xs" <vn-spinner class="vn-pa-xs"
ng-if="$ctrl.edit.mana == null" ng-if="$ctrl.edit.mana == null"
enable="true"> enable="true">
@ -247,9 +246,8 @@
<!-- Discount popover --> <!-- Discount popover -->
<vn-popover <vn-popover
vn-id="editDiscount" vn-id="editDiscount"
on-open="$ctrl.getMana()" on-open="$ctrl.getMana()">
on-close="$ctrl.edit = null"> <div class="edit-popover">
<div class="edit-price">
<vn-spinner class="vn-pa-xs" <vn-spinner class="vn-pa-xs"
ng-if="$ctrl.edit.mana == null" ng-if="$ctrl.edit.mana == null"
enable="true"> enable="true">
@ -287,7 +285,6 @@
<!-- Multiple discount dialog --> <!-- Multiple discount dialog -->
<vn-dialog vn-id="editDiscountDialog" <vn-dialog vn-id="editDiscountDialog"
on-open="$ctrl.getMana()" on-open="$ctrl.getMana()"
on-close="$ctrl.edit = null"
message="Edit discount"> message="Edit discount">
<tpl-body> <tpl-body>
<vn-spinner class="vn-pa-xs" <vn-spinner class="vn-pa-xs"

View File

@ -328,7 +328,7 @@ class Controller extends Section {
const query = `Sales/${sale.id}/updatePrice`; const query = `Sales/${sale.id}/updatePrice`;
this.$http.post(query, {newPrice}).then(res => { this.$http.post(query, {newPrice}).then(res => {
sale.price = res.data.price; sale.price = res.data.price;
this.edit = null;
this.vnApp.showSuccess(this.$t('Data saved!')); this.vnApp.showSuccess(this.$t('Data saved!'));
}).finally(() => { }).finally(() => {
if (this.newInstances().length === 0) if (this.newInstances().length === 0)
@ -399,6 +399,8 @@ class Controller extends Section {
for (let sale of sales) for (let sale of sales)
sale.discount = this.edit.discount; sale.discount = this.edit.discount;
this.edit = null;
}).catch(e => { }).catch(e => {
this.vnApp.showError(e.message); this.vnApp.showError(e.message);
}); });
@ -614,7 +616,7 @@ class Controller extends Section {
calculateSalePrice() { calculateSalePrice() {
const sale = this.checkedLines()[0]; const sale = this.checkedLines()[0];
const query = `Sales/${sale.id}/recalculatePrice`; const query = `Sales/${sale.id}/recalculatePrice`;
this.$http.post(query).then(res => { this.$http.post(query).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!')); this.vnApp.showSuccess(this.$t('Data saved!'));
this.$.model.refresh(); this.$.model.refresh();
}); });

View File

@ -24,7 +24,7 @@ vn-ticket-sale {
} }
} }
vn-dialog.edit { vn-dialog.edit {
@extend .edit-price; @extend .edit-popover;
&>div{ &>div{
padding: 0!important; padding: 0!important;
@ -81,8 +81,9 @@ vn-ticket-sale {
width: 400px width: 400px
} }
} }
.edit-price { .vn-popover .edit-popover {
min-width: 200px; min-width: 200px;
text-align: center;
section.header { section.header {
background-color: $color-main; background-color: $color-main;