From 3255e11cfcf472df693d58cd2de996ef50c57cd0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 24 Jun 2021 17:59:32 +0100 Subject: [PATCH] Limit annotations to badge type --- .../@node-red/editor-client/src/js/ui/view-annotations.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view-annotations.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view-annotations.js index e3a6a1114..1df8c4bd1 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view-annotations.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view-annotations.js @@ -61,7 +61,7 @@ RED.view.annotations = (function() { * @param {type} opts - annotations options * * opts: { - * type: "badge"|"annotation" + * type: "badge" * class: "", * element: function(node), * show: string|function(node), @@ -69,6 +69,9 @@ RED.view.annotations = (function() { * } */ function register(id, opts) { + if (opts.type !== 'badge') { + throw new Error("Unsupported annotation type: "+opts.type); + } annotations[id] = opts RED.hooks.add("viewAddNode.annotation-"+id, function(evt) { if (opts.filter && !opts.filter(evt.node)) {