Commit 1bfdad5c authored by Clement Ho's avatar Clement Ho

Code review changes

parent 3d0b0a62
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
break; break;
case 'projects:merge_requests:index': case 'projects:merge_requests:index':
case 'projects:issues:index': case 'projects:issues:index':
if (document.querySelector('.filtered-search') && gl.FilteredSearchManager) { if (gl.FilteredSearchManager) {
new gl.FilteredSearchManager(); new gl.FilteredSearchManager();
} }
Issuable.init(); Issuable.init();
......
...@@ -39,7 +39,7 @@ require('../window')(function(w){ ...@@ -39,7 +39,7 @@ require('../window')(function(w){
var loadingTemplate = document.createElement('div'); var loadingTemplate = document.createElement('div');
loadingTemplate.innerHTML = config.loadingTemplate; loadingTemplate.innerHTML = config.loadingTemplate;
loadingTemplate.setAttribute('data-loading-template', true); loadingTemplate.setAttribute('data-loading-template', '');
this.listTemplate = dynamicList.outerHTML; this.listTemplate = dynamicList.outerHTML;
dynamicList.outerHTML = loadingTemplate.outerHTML; dynamicList.outerHTML = loadingTemplate.outerHTML;
......
(() => { (() => {
class FilteredSearchTokenizer { class FilteredSearchTokenizer {
static processTokens(input) { static processTokens(input) {
// Regex extracts `(token):(symbol)(value)`
// Values that start with a double quote must end in a double quote (same for single)
const tokenRegex = /(\w+):([~%@]?)(?:('[^']*'{0,1})|("[^"]*"{0,1})|(\S+))/g; const tokenRegex = /(\w+):([~%@]?)(?:('[^']*'{0,1})|("[^"]*"{0,1})|(\S+))/g;
const tokens = []; const tokens = [];
let lastToken = null; let lastToken = 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