Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6eafd748
Commit
6eafd748
authored
Dec 12, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code styling issues
parent
16e3fe3f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
+1
-1
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
...vascripts/filtered_search/filtered_search_dropdown.js.es6
+5
-4
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
...s/filtered_search/filtered_search_dropdown_manager.js.es6
+10
-10
No files found.
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
View file @
6eafd748
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
}
}
itemClicked(e) {
itemClicked(e) {
const
selected = e.detail.selected
;
const
{ selected } = e.detail
;
if (selected.hasAttribute('data-value')) {
if (selected.hasAttribute('data-value')) {
this.dismissDropdown();
this.dismissDropdown();
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
View file @
6eafd748
...
@@ -24,14 +24,15 @@
...
@@ -24,14 +24,15 @@
}
}
getCurrentHook() {
getCurrentHook() {
return this.droplab.hooks.filter(h => h.id === this.hookId)[0];
return this.droplab.hooks.filter(h => h.id === this.hookId)[0]
|| null
;
}
}
itemClicked(e, getValueFunction) {
itemClicked(e, getValueFunction) {
const dataValueSet = this.setDataValueIfSelected(e.detail.selected);
const { selected } = e.detail;
const dataValueSet = this.setDataValueIfSelected(selected);
if (!dataValueSet) {
if (!dataValueSet) {
const value = getValueFunction(
e.detail.
selected);
const value = getValueFunction(selected);
gl.FilteredSearchDropdownManager.addWordToInput(value);
gl.FilteredSearchDropdownManager.addWordToInput(value);
}
}
...
@@ -67,7 +68,7 @@
...
@@ -67,7 +68,7 @@
this.setAsDropdown();
this.setAsDropdown();
const currentHook = this.getCurrentHook();
const currentHook = this.getCurrentHook();
const firstTimeInitialized = currentHook ===
undefined
;
const firstTimeInitialized = currentHook ===
null
;
if (firstTimeInitialized || forceRenderContent) {
if (firstTimeInitialized || forceRenderContent) {
this.renderContent(forceShowList);
this.renderContent(forceShowList);
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
View file @
6eafd748
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
}
}
static addWordToInput(word, addSpace = false) {
static addWordToInput(word, addSpace = false) {
const input = document.querySelector('.filtered-search')
const input = document.querySelector('.filtered-search')
;
const value = input.value;
const value = input.value;
const hasExistingValue = value.length !== 0;
const hasExistingValue = value.length !== 0;
const { lastToken } = gl.FilteredSearchTokenizer.processTokens(value);
const { lastToken } = gl.FilteredSearchTokenizer.processTokens(value);
...
@@ -88,22 +88,22 @@
...
@@ -88,22 +88,22 @@
}
}
load(key, firstLoad = false) {
load(key, firstLoad = false) {
cons
ole.log(`🦄 load ${key} dropdown`)
;
cons
t mappingKey = this.mapping[key]
;
const glClass =
this.mapping[key]
.gl;
const glClass =
mappingKey
.gl;
const element =
this.mapping[key]
.element;
const element =
mappingKey
.element;
let forceShowList = false;
let forceShowList = false;
if (!
this.mapping[key]
.reference) {
if (!
mappingKey
.reference) {
const dl = this.droplab;
const dl = this.droplab;
const defaultArguments = [null, dl, element, this.filteredSearchInput];
const defaultArguments = [null, dl, element, this.filteredSearchInput];
const glArguments = defaultArguments.concat(
this.mapping[key]
.extraArguments || []);
const glArguments = defaultArguments.concat(
mappingKey
.extraArguments || []);
// Passing glArguments to `new gl[glClass](<arguments>)`
// Passing glArguments to `new gl[glClass](<arguments>)`
this.mapping[key]
.reference = new (Function.prototype.bind.apply(gl[glClass], glArguments));
mappingKey
.reference = new (Function.prototype.bind.apply(gl[glClass], glArguments));
}
}
if (firstLoad) {
if (firstLoad) {
this.mapping[key]
.reference.init();
mappingKey
.reference.init();
}
}
if (this.currentDropdown === 'hint') {
if (this.currentDropdown === 'hint') {
...
@@ -112,7 +112,7 @@
...
@@ -112,7 +112,7 @@
}
}
this.updateDropdownOffset(key);
this.updateDropdownOffset(key);
this.mapping[key]
.reference.render(firstLoad, forceShowList);
mappingKey
.reference.render(firstLoad, forceShowList);
this.currentDropdown = key;
this.currentDropdown = key;
}
}
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
loadDropdown(dropdownName = '') {
loadDropdown(dropdownName = '') {
let firstLoad = false;
let firstLoad = false;
if(!this.droplab) {
if
(!this.droplab) {
firstLoad = true;
firstLoad = true;
this.droplab = new DropLab();
this.droplab = new DropLab();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment