move modals to notifications (to open the modals)

This commit is contained in:
negue
2018-07-20 23:56:36 +02:00
parent 284b2cc413
commit b75e65f42d
4 changed files with 95 additions and 34 deletions

View File

@@ -53,12 +53,12 @@ export default {
itemName,
}));
},
streak (val) {
this.notify(`${val}`, 'streak');
streak (val, onClick) {
this.notify(`${val}`, 'streak', null, null, onClick, typeof onClick === 'undefined');
},
text (val, onClick) {
text (val, onClick, timeout) {
if (!val) return;
this.notify(val, 'info', null, null, onClick);
this.notify(val, 'info', null, null, onClick, timeout);
},
sign (number) {
return getSign(number);
@@ -66,14 +66,19 @@ export default {
round (number, nDigits) {
return round(number, nDigits);
},
notify (html, type, icon, sign) {
notify (html, type, icon, sign, onClick, timeout) {
if (typeof timeout === 'undefined') {
timeout = true;
}
this.$store.dispatch('snackbars:add', {
title: '',
text: html,
type,
icon,
sign,
timeout: true,
onClick,
timeout,
});
},
},