revert Bug #575 ng-click se llama en los vn-button deshabilitados
This commit is contained in:
parent
dd22309e7c
commit
84462be55a
|
@ -1,4 +1,4 @@
|
|||
<button type="{{::$ctrl.type}}" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" ng-click="$ctrl.onClick()">
|
||||
<button type="{{::$ctrl.type}}" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
|
||||
<span translate>{{$ctrl.label}}</span>
|
||||
<vn-icon
|
||||
icon="{{::$ctrl.icon}}"
|
||||
|
|
|
@ -16,8 +16,7 @@ ngModule.component('vnButton', {
|
|||
bindings: {
|
||||
label: '@?',
|
||||
disabled: '<?',
|
||||
icon: '@?',
|
||||
onClick: '&'
|
||||
icon: '@?'
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
data="sales" on-data-change="$ctrl.onDataChange()">
|
||||
</vn-crud-model>
|
||||
|
||||
<vn-watcher
|
||||
vn-id="watcher"
|
||||
data="sales">
|
||||
</vn-watcher>
|
||||
|
||||
<vn-vertical>
|
||||
<vn-card pad-large>
|
||||
<vn-vertical>
|
||||
|
@ -13,7 +18,7 @@
|
|||
<vn-button
|
||||
disabled="!$ctrl.isEditable"
|
||||
label="Ok"
|
||||
on-click="$ctrl.onStateOkClick()">
|
||||
ng-click="$ctrl.onStateOkClick()">
|
||||
</vn-button>
|
||||
<vn-icon-menu
|
||||
disabled="!$ctrl.isEditable"
|
||||
|
@ -32,14 +37,14 @@
|
|||
</vn-icon-menu>
|
||||
<vn-button
|
||||
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
||||
on-click="$ctrl.showRemoveLinesDialog()"
|
||||
ng-click="$ctrl.showRemoveLinesDialog()"
|
||||
vn-tooltip="Remove lines"
|
||||
tooltip-position="up"
|
||||
icon="delete">
|
||||
</vn-button>
|
||||
<vn-button
|
||||
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
||||
on-click="$ctrl.showTransferPopover($event);"
|
||||
ng-click="$ctrl.showTransferPopover($event);"
|
||||
vn-tooltip="Transfer lines"
|
||||
tooltip-position="right"
|
||||
icon="call_split">
|
||||
|
@ -96,7 +101,7 @@
|
|||
<vn-td ng-if="$ctrl.isEditable" number>
|
||||
<vn-textfield
|
||||
model="sale.quantity"
|
||||
accept="$ctrl.updateQuantity(sale.id, sale.quantity)"
|
||||
on-change="$ctrl.updateQuantity(sale.id, sale.quantity)"
|
||||
type="text">
|
||||
</vn-textfield>
|
||||
</vn-td>
|
||||
|
|
|
@ -5,7 +5,7 @@ class Controller {
|
|||
constructor($scope, $state, $http, vnApp, $translate) {
|
||||
this.$scope = $scope;
|
||||
this.vnApp = vnApp;
|
||||
this.translate = $translate;
|
||||
this.$translate = $translate;
|
||||
this.$state = $state;
|
||||
this.$stateParams = $state.params;
|
||||
this.$http = $http;
|
||||
|
@ -116,7 +116,7 @@ class Controller {
|
|||
let params = {ticketFk: this.$state.params.id, stateFk: value};
|
||||
this.$http.post(`/ticket/api/TicketTrackings/changeState`, params).then(() => {
|
||||
this.card.reload();
|
||||
this.vnApp.showSuccess(this.translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -129,12 +129,14 @@ class Controller {
|
|||
let params = {ticketFk: this.$state.params.id, weekDay: day};
|
||||
this.$http.patch(`/ticket/api/TicketWeeklies`, params).then(() => {
|
||||
this.$scope.addTurn.hide();
|
||||
this.vnApp.showSuccess(this.translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
});
|
||||
}
|
||||
|
||||
// Delete Ticket
|
||||
showDeleteTicketDialog() {
|
||||
if (!this.isEditable)
|
||||
return;
|
||||
this.$scope.deleteConfirmation.show();
|
||||
}
|
||||
|
||||
|
@ -143,7 +145,7 @@ class Controller {
|
|||
let params = {id: this.$state.params.id};
|
||||
this.$http.post(`/ticket/api/Tickets/deleted`, params).then(() => {
|
||||
this.$state.go('ticket.index');
|
||||
this.vnApp.showSuccess(this.translate.instant('Ticket deleted'));
|
||||
this.vnApp.showSuccess(this.$translate.instant('Ticket deleted'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +267,7 @@ class Controller {
|
|||
this.$http.post(`/ticket/api/Sales/updatePrice`, {id: this.edit.id, price: this.editedPrice, ticketFk: this.ticket.id}).then(() => {
|
||||
this.sale.price = this.edit.price;
|
||||
this.$scope.model.refresh();
|
||||
this.vnApp.showSuccess(this.translate.instant('Data saved!'));
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
});
|
||||
}
|
||||
this.$scope.editPricePopover.hide();
|
||||
|
@ -303,9 +305,9 @@ class Controller {
|
|||
|
||||
updateQuantity(id, quantity) {
|
||||
this.$http.post(`/ticket/api/Sales/${id}/updateQuantity`, {quantity: parseInt(quantity)}).then(() => {
|
||||
this.vnApp.showSuccess(this.translate.instant('Data saved!'));
|
||||
});
|
||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||
this.$scope.model.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,6 @@ New ticket: Nuevo ticket
|
|||
Edit price: Editar precio
|
||||
You are going to delete lines of the ticket: Vas a borrar lineas del ticket
|
||||
Continue anyway?: ¿Estás seguro?
|
||||
The new quantity should be smaller than the old one: La nueva cantidad debe de ser menor que la anterior
|
||||
You have to allow pop-ups in your web browser to use this functionality:
|
||||
Debes permitir los pop-pups en tu navegador para que esta herramienta funcione correctamente
|
||||
Disc: Dto
|
||||
|
|
Loading…
Reference in New Issue