forked from nathalie/pedi2
El toast ahora dura 2s
This commit is contained in:
parent
f50d4b975d
commit
5a4a1ff391
|
@ -33,10 +33,10 @@ Vue.prototype.$rootMiga = {
|
||||||
Vue.prototype.$settearProducto = function(cantidad, id) {
|
Vue.prototype.$settearProducto = function(cantidad, id) {
|
||||||
Event.$emit("sync-subpedido", this.cant, this.producto.id)
|
Event.$emit("sync-subpedido", this.cant, this.producto.id)
|
||||||
}
|
}
|
||||||
Vue.prototype.$toast = function(mensaje) {
|
Vue.prototype.$toast = function(mensaje, duration = 1000) {
|
||||||
return window.bulmaToast.toast({
|
return window.bulmaToast.toast({
|
||||||
message: mensaje,
|
message: mensaje,
|
||||||
duration: 1000,
|
duration: duration,
|
||||||
type: 'is-danger',
|
type: 'is-danger',
|
||||||
position: 'bottom-center',
|
position: 'bottom-center',
|
||||||
animate: { in: 'fadeIn', out: 'fadeOut' }
|
animate: { in: 'fadeIn', out: 'fadeOut' }
|
||||||
|
@ -70,7 +70,7 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
Event.$on('sync-subpedido', (cantidad, id) => {
|
Event.$on('sync-subpedido', (cantidad, id) => {
|
||||||
if (this.pedido.aprobado) {
|
if (this.pedido.aprobado) {
|
||||||
this.$toast('No se puede modificar un pedido ya aprobado');
|
this.$toast('No se puede modificar un pedido ya aprobado', 2000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
axios.post("/api/subpedidos/" + this.pedido.id + "/sync", {
|
axios.post("/api/subpedidos/" + this.pedido.id + "/sync", {
|
||||||
|
|
Loading…
Reference in New Issue