summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/getters.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-04-12 09:43:46 +0100
committerPhil Hughes <me@iamphill.com>2018-04-16 09:48:57 +0100
commitd32eaee20e75ca2e90397182dce59ee263f5c249 (patch)
tree7208034306c12b7547b8cda8c9fd47131eb81b6d /app/assets/javascripts/ide/stores/getters.js
parent748a2f2b542fed2cb8ab7d1792cb874ce7423a61 (diff)
downloadgitlab-ce-d32eaee20e75ca2e90397182dce59ee263f5c249.tar.gz
correctly show the dropdown with `t` keypress
added arrow key navigation in the dropdown enter & click open the file highlight occurrences of the searched text in the drppdown item fixed some performance issues when rendering limit the dropdown items to a maximum of 20 - this may change to more depending on other performance changes
Diffstat (limited to 'app/assets/javascripts/ide/stores/getters.js')
-rw-r--r--app/assets/javascripts/ide/stores/getters.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/assets/javascripts/ide/stores/getters.js b/app/assets/javascripts/ide/stores/getters.js
index 6776be3b77c..07f7e73d8e9 100644
--- a/app/assets/javascripts/ide/stores/getters.js
+++ b/app/assets/javascripts/ide/stores/getters.js
@@ -37,4 +37,12 @@ export const hasChanges = state => !!state.changedFiles.length;
export const hasMergeRequest = state => !!state.currentMergeRequestId;
export const allBlobs = state =>
- Object.keys(state.entries).reduce((acc, key) => acc.concat(state.entries[key]), []);
+ Object.keys(state.entries).reduce((acc, key) => {
+ const entry = state.entries[key];
+
+ if (entry.type === 'blob') {
+ acc.push(entry);
+ }
+
+ return acc;
+ }, []);