1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add some docs to autoComplete widget

This commit is contained in:
Nick O'Leary 2021-10-05 20:41:21 +01:00
parent 7f9e318214
commit 421d155586
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 20 additions and 13 deletions

View File

@ -1,10 +1,27 @@
(function($) {
/**
* Attach to an <input type="text"> to provide auto-complete
*
* $("#node-red-text").autoComplete({
* search: function(value) { return ['a','b','c'] }
* })
*
* 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", {
@ -93,16 +110,6 @@
if (this.completionMenuShown) {
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);

View File

@ -89,8 +89,8 @@
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 = [
{ value: "payload" },
{ value: "req", source: ["http in"]},