case 4518, also added override of timeout to all notify variants
This commit is contained in:
@@ -27,7 +27,8 @@ export default {
|
||||
//ERROR
|
||||
window.$gz.eventBus.$on("notify-error", function handleNotifyWarn(
|
||||
msg,
|
||||
helpUrl
|
||||
helpUrl,
|
||||
overrideTimeout
|
||||
) {
|
||||
//log full message
|
||||
window.$gz.store.commit("logItem", "notify-error: " + msg);
|
||||
@@ -36,7 +37,7 @@ export default {
|
||||
vm.$root.$gznotify({
|
||||
message: msg,
|
||||
type: "error",
|
||||
timeout: CalculateDelay(msg),
|
||||
timeout: overrideTimeout ?? CalculateDelay(msg),
|
||||
helpUrl: helpUrl
|
||||
});
|
||||
});
|
||||
@@ -62,14 +63,15 @@ export default {
|
||||
//INFO
|
||||
window.$gz.eventBus.$on("notify-info", function handleNotifyInfo(
|
||||
msg,
|
||||
helpUrl
|
||||
helpUrl,
|
||||
overrideTimeout
|
||||
) {
|
||||
window.$gz.store.commit("logItem", "notify-info: " + msg);
|
||||
msg = msg.substring(0, 600);
|
||||
vm.$root.$gznotify({
|
||||
message: msg,
|
||||
type: "info",
|
||||
timeout: CalculateDelay(msg),
|
||||
timeout: overrideTimeout ?? CalculateDelay(msg),
|
||||
helpUrl: helpUrl
|
||||
});
|
||||
});
|
||||
@@ -78,13 +80,15 @@ export default {
|
||||
//SUCCESS
|
||||
window.$gz.eventBus.$on("notify-success", function handleNotifySuccess(
|
||||
msg,
|
||||
helpUrl
|
||||
helpUrl,
|
||||
overrideTimeout
|
||||
) {
|
||||
vm.$root.$gznotify({
|
||||
message: msg,
|
||||
type: "success",
|
||||
timeout: CalculateDelay(msg),
|
||||
helpUrl: helpUrl
|
||||
timeout: overrideTimeout ?? CalculateDelay(msg),
|
||||
helpUrl: helpUrl,
|
||||
overrideTimeout
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:value="isVisible"
|
||||
:color="currentNotification.type"
|
||||
multi-line
|
||||
:timeout="currentNotification.timeout"
|
||||
>
|
||||
<v-alert :type="currentNotification.type" mode="out-in">
|
||||
{{ currentNotification.message }}
|
||||
@@ -35,6 +36,7 @@ export default {
|
||||
}),
|
||||
methods: {
|
||||
addNotification(options) {
|
||||
console.log("Add notification options:", options);
|
||||
if (!options.message) {
|
||||
return;
|
||||
}
|
||||
@@ -61,6 +63,7 @@ export default {
|
||||
this.isVisible = true;
|
||||
});
|
||||
//Show it for the designated time before moving on to the next
|
||||
|
||||
setTimeout(() => {
|
||||
this.isVisible = false;
|
||||
//recurse
|
||||
|
||||
Reference in New Issue
Block a user