From ed3aa8189f2a0e59de71cf9bf0ac539e1a02d91a Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 11 May 2021 14:45:53 +0100 Subject: [PATCH] Shrink default notification box Also reduces Inject/Debug notification display time as 5 seconds is a long time for a message telling you it worked --- .../@node-red/editor-client/src/sass/notifications.scss | 3 ++- .../node_modules/@node-red/nodes/core/common/20-inject.html | 2 +- .../node_modules/@node-red/nodes/core/common/21-debug.html | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/sass/notifications.scss b/packages/node_modules/@node-red/editor-client/src/sass/notifications.scss index 497ca78cd..e2617f995 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/notifications.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/notifications.scss @@ -25,7 +25,7 @@ .red-ui-notification { box-sizing: border-box; position: relative; - padding: 14px 18px; + padding: 8px 18px 0px; margin-bottom: 4px; box-shadow: 0 1px 1px 1px $shadow; background-color: $secondary-background; @@ -35,6 +35,7 @@ overflow: hidden; .ui-dialog-buttonset { margin-top: 20px; + margin-bottom: 10px; } } .red-ui-notification p:first-child { diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index 717752377..bb22ee90f 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -636,7 +636,7 @@ url: "inject/"+this.id, type:"POST", success: function(resp) { - RED.notify(node._("inject.success",{label:label}),{type:"success",id:"inject"}); + RED.notify(node._("inject.success",{label:label}),{type:"success",id:"inject", timeout: 2000}); }, error: function(jqXHR,textStatus,errorThrown) { if (jqXHR.status == 404) { diff --git a/packages/node_modules/@node-red/nodes/core/common/21-debug.html b/packages/node_modules/@node-red/nodes/core/common/21-debug.html index 8691dfbea..886ed68fa 100644 --- a/packages/node_modules/@node-red/nodes/core/common/21-debug.html +++ b/packages/node_modules/@node-red/nodes/core/common/21-debug.html @@ -129,9 +129,9 @@ RED.history.push(historyEvent); RED.view.redraw(); if (xhr.status == 200) { - RED.notify(node._("debug.notification.activated",{label:label}),"success"); + RED.notify(node._("debug.notification.activated",{label:label}),{type: "success", timeout: 2000}); } else if (xhr.status == 201) { - RED.notify(node._("debug.notification.deactivated",{label:label}),"success"); + RED.notify(node._("debug.notification.deactivated",{label:label}),{type: "success", timeout: 2000}); } }); }