mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Limit annotations to badge type
This commit is contained in:
		| @@ -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)) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user