Commit 69d57700 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

autocomplete.js change matcher for samples.

Due to the lack of a flag to start matching text, it was necessary to
alter the matcher to allow us to start matching the last element in an
input without. The lack of a flag means that all the text in the input
is matched to the query and therefore we needed to extract the last
matching string to autocomplete.
parent 0492c455
......@@ -138,10 +138,10 @@ VidjilAutoComplete.prototype = {
callbacks.matcher = function(flag, subtext) {
var regex = new RegExp("[\\s\\S]+");
var match = regex.exec(subtext);
var regex = /:?([\s0-9a-z_\[\]\(\)]+),?\s*/ig
var match = subtext.match(regex);
if (match) {
return match[0];
return match[match.length - 1];
return null;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment