mirror of
https://github.com/sergeyyarkov/digital-store.git
synced 2026-10-11 02:09:05 +03:00
materialize toast
This commit is contained in:
parent
7f7ce78f83
commit
fc74b3303c
2
dist/public/js/main.js
vendored
2
dist/public/js/main.js
vendored
File diff suppressed because one or more lines are too long
@ -101,7 +101,7 @@ function renderObj(obj, context, target) {
|
|||||||
target.classList.add('orange');
|
target.classList.add('orange');
|
||||||
target.querySelector('i').innerHTML = 'close';
|
target.querySelector('i').innerHTML = 'close';
|
||||||
insertCount('counter', context.cart);
|
insertCount('counter', context.cart);
|
||||||
context.notification.notificate('Товар был успешно добавлен в корзину.', '#26A69A');
|
window.M.toast({html: 'Товар был успешно добавлен в корзину.'})
|
||||||
} else {
|
} else {
|
||||||
context.cart.splice(index, 1);
|
context.cart.splice(index, 1);
|
||||||
localStorage.setItem('cart', JSON.stringify(context.cart));
|
localStorage.setItem('cart', JSON.stringify(context.cart));
|
||||||
@ -115,6 +115,6 @@ function renderObj(obj, context, target) {
|
|||||||
target.classList.add('orange');
|
target.classList.add('orange');
|
||||||
target.querySelector('i').innerHTML = 'close';
|
target.querySelector('i').innerHTML = 'close';
|
||||||
insertCount('counter', context.cart);
|
insertCount('counter', context.cart);
|
||||||
context.notification.notificate('Товар был успешно добавлен в корзину.', '#26A69A');
|
window.M.toast({html: 'Товар был успешно добавлен в корзину.'})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -21,13 +21,13 @@ export class OrdersComponent extends Component {
|
|||||||
|
|
||||||
switch (request.data.status) {
|
switch (request.data.status) {
|
||||||
case 'OK':
|
case 'OK':
|
||||||
this.notification.notificate(`Данные были успешно высланы на почту "${email}".`, '#26A69A', 3500);
|
window.M.toast({html: `Данные были успешно высланы на почту "${email}".`})
|
||||||
break;
|
break;
|
||||||
case 'NF':
|
case 'NF':
|
||||||
this.notification.notificate(`Покупатель с почтой "${email}" не был найден.`, '#f44336', 3500);
|
window.M.toast({html: `Покупатель с почтой "${email}" не был найден.`})
|
||||||
break;
|
break;
|
||||||
case 'ERR':
|
case 'ERR':
|
||||||
this.notification.notificate(`Произошла ошибка, попробуйте повторить запрос позже.`, '#f44336', 3500);
|
window.M.toast({html: `Произошла ошибка, попробуйте повторить запрос позже.`})
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -35,7 +35,7 @@ export class OrdersComponent extends Component {
|
|||||||
this.loader.hide();
|
this.loader.hide();
|
||||||
setTimeout(() => valid = true, 10000);
|
setTimeout(() => valid = true, 10000);
|
||||||
} else {
|
} else {
|
||||||
this.notification.notificate(`Подождите еще нескольно секунд прежде чем сделать запрос...`, '#f44336', 3500);
|
window.M.toast({html: `Подождите еще нескольно секунд прежде чем сделать запрос...`})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user