mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add some docs to autoComplete widget
This commit is contained in:
		| @@ -1,10 +1,27 @@ | |||||||
| (function($) { | (function($) { | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  |  * Attach to an <input type="text"> to provide auto-complete | ||||||
|  |  * | ||||||
|  |  * $("#node-red-text").autoComplete({ | ||||||
|  |  *     search: function(value) { return ['a','b','c'] } | ||||||
|  |  * }) | ||||||
|  |  * | ||||||
|  * options: |  * options: | ||||||
|  * |  * | ||||||
|  * methods: |  *  search : function(value, [done]) | ||||||
|  |  *           A function that is passed the current contents of the input whenever | ||||||
|  |  *           it changes. | ||||||
|  |  *           The function must either return auto-complete options, or pass them | ||||||
|  |  *           to the optional 'done' parameter. | ||||||
|  |  *           If the function signature includes 'done', it must be used | ||||||
|  * |  * | ||||||
|  |  * The auto-complete options should be an array of objects in the form: | ||||||
|  |  *  { | ||||||
|  |  *      value: String : the value to insert if selected | ||||||
|  |  *      label: String|DOM Element : the label to display in the dropdown. | ||||||
|  |  *  } | ||||||
|  |  *  | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|     $.widget( "nodered.autoComplete", { |     $.widget( "nodered.autoComplete", { | ||||||
| @@ -93,16 +110,6 @@ | |||||||
|             if (this.completionMenuShown) { |             if (this.completionMenuShown) { | ||||||
|                 this.menu.hide(); |                 this.menu.hide(); | ||||||
|             } |             } | ||||||
|         }, |         } | ||||||
|         // disable: function(val) { |  | ||||||
|         //     if(val === undefined || !!val ) { |  | ||||||
|         // |  | ||||||
|         //     } else { |  | ||||||
|         //         this.uiSelect.attr("disabled", null); //remove attr |  | ||||||
|         //     } |  | ||||||
|         // }, |  | ||||||
|         // enable: function() { |  | ||||||
|         //     this.uiSelect.attr("disabled", null); //remove attr |  | ||||||
|         // }, |  | ||||||
|     }); |     }); | ||||||
| })(jQuery); | })(jQuery); | ||||||
|   | |||||||
| @@ -89,8 +89,8 @@ | |||||||
|             return matches; |             return matches; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     // This is a hand-generated list of completions for the core nodes (based on the node help html). |  | ||||||
|  |  | ||||||
|  |     // This is a hand-generated list of completions for the core nodes (based on the node help html). | ||||||
|     var msgCompletions = [ |     var msgCompletions = [ | ||||||
|         { value: "payload" }, |         { value: "payload" }, | ||||||
|         { value: "req", source: ["http in"]}, |         { value: "req", source: ["http in"]}, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user