Skip to content
Snippets Groups Projects
Verified Commit fa33cd5c authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: quotation in ext_autocomplete

parent 10f729b5
No related branches found
No related tags found
2 merge requests!59REL: release 0.4.1,!58F query quotation
Pipeline #15523 failed
......@@ -111,17 +111,6 @@ var ext_autocomplete = new function () {
["names"]))).find("Property[name],RecordType[name],Record[name]")
response = response.toArray().map(x => $(x).attr("name"));
// attach quotation if white space
response = response.map((x) => {
if(x.indexOf(" ") > -1) {
if(x.indexOf("\"") > -1) {
return `'${x}'`;
} else {
return `"${x}"`;
}
}
return x;
});
response = response.concat(ext_autocomplete.CQL_WORDS);
return response
......@@ -169,8 +158,16 @@ var ext_autocomplete = new function () {
var start = newValue.slice(0, beginning_of_word + 1);
var end = origJQElement[0].value.slice(cursorpos);
var result = resultsFromServer.map(x => {
var x_quoted = x;
if (x.indexOf(" ") > -1) {
if(x.indexOf("\"") > -1) {
x_quoted = `'${x}'`;
} else {
x_quoted = `"${x}"`;
}
}
return {
text: start + x + end,
text: start + x_quoted + end,
html: x
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment