Skip to content
Snippets Groups Projects
Commit 6a8793b0 authored by echicken's avatar echicken :chicken:
Browse files

Added 'autoDelete' setting. Probably needs some more work.

If true, and if this is our first input, and if the users types
something that would otherwise have been appended to the default
text, then the default text is deleted first.
parent 0ffd795b
No related branches found
No related tags found
No related merge requests found
......@@ -238,6 +238,8 @@ var Typeahead = function (options) {
attr: console.attributes,
focus: true,
maxResults: 0,
autoDelete: false,
gotInput: false,
};
var display = {
......@@ -460,6 +462,10 @@ var Typeahead = function (options) {
}
break;
default:
if (properties.autoDelete && !properties.gotInput) {
properties.text = '';
properties.position = 0;
}
if (properties.text.length === properties.len) break;
key = strip_ctrl(key);
if (properties.position !== properties.text.length) {
......@@ -476,6 +482,7 @@ var Typeahead = function (options) {
change = true;
break;
}
properties.gotInput = true;
if (change) {
display.inputFrame.clear();
display.inputFrame.putmsg(properties.text);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment