Fix Modal Stack - reopening modals (#10493)

* use fallback target.id - only scroll modal content (not the page)

* fix lint

* debug information

* add snackbar onClick callback - use notification instead of modal for joined-challenge

* revert console.log / fix lint
This commit is contained in:
negue
2018-07-20 22:50:40 +02:00
committed by Sabe Jones
parent b7a46637d5
commit 7b562c45cf
5 changed files with 35 additions and 9 deletions

View File

@@ -56,9 +56,9 @@ export default {
streak (val) {
this.notify(`${val}`, 'streak');
},
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,
});
},
},