Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-10-20 12:47:45 +0300
committerPhil Hughes <me@iamphill.com>2017-10-23 12:47:22 +0300
commit4699cf77b6a0f5261ae382ac1a55882424efe4fb (patch)
tree90ed6e103fc273625744ae40bf5957fa459e8e02 /app/assets/javascripts/repo
parent4c186f99f2ce72dfe3cd3e64b84b5ea5761f1657 (diff)
added feature spec
Diffstat (limited to 'app/assets/javascripts/repo')
-rw-r--r--app/assets/javascripts/repo/helpers/repo_helper.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/repo/helpers/repo_helper.js b/app/assets/javascripts/repo/helpers/repo_helper.js
index 8b73a1020a0..9e53ffe9a6f 100644
--- a/app/assets/javascripts/repo/helpers/repo_helper.js
+++ b/app/assets/javascripts/repo/helpers/repo_helper.js
@@ -98,8 +98,8 @@ const RepoHelper = {
.then((response) => {
const data = response.data;
if (response.headers && response.headers['page-title']) data.pageTitle = decodeURI(response.headers['page-title']);
- if (response.headers && response.headers['is-root'] && !Store.isInitialRoot) {
- Store.isRoot = convertPermissionToBoolean(response.headers['is-root']);
+ if (data.path && !Store.isInitialRoot) {
+ Store.isRoot = data.path === '/';
Store.isInitialRoot = Store.isRoot;
}
@@ -140,6 +140,10 @@ const RepoHelper = {
addToDirectory(file, data) {
const tree = file || Store;
+
+ // TODO: Figure out why `popstate` is being trigger in the specs
+ if (!tree.files) return;
+
const files = tree.files.concat(this.dataToListOfFiles(data, file ? file.level + 1 : 0));
tree.files = files;
@@ -236,7 +240,8 @@ const RepoHelper = {
return Store.openedFiles.find(file => file.url === path);
},
- loadingError() {
+ loadingError(e) {
+ console.log(e);
Flash('Unable to load this content at this time.');
},