Commit fc62a0fe authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Fix repo_sidebar linting

parent 1f89de11
......@@ -17,14 +17,14 @@ const RepoHelper = {
getLanguageForFile(file, langs) {
const ext = `.${file.name.split('.').pop()}`;
let foundLang;
if(langs.some((l) => {
if(l.extensions && l.extensions.indexOf(ext) > -1) {
if (langs.some((l) => {
if (l.extensions && l.extensions.indexOf(ext) > -1) {
foundLang = l;
return true;
}
return false;
})) {
return foundLang.id
return foundLang.id;
}
return 'plain';
},
......
import Service from './repo_service'
import Helper from './repo_helper'
import Vue from 'vue'
import Store from './repo_store'
import RepoPreviousDirectory from './repo_prev_directory'
import RepoFileOptions from './repo_file_options'
import RepoFile from './repo_file'
import RepoLoadingFile from './repo_loading_file'
import RepoMiniMixin from './repo_mini_mixin'
import Vue from 'vue';
import Service from './repo_service';
import Helper from './repo_helper';
import Store from './repo_store';
import RepoPreviousDirectory from './repo_prev_directory';
import RepoFileOptions from './repo_file_options';
import RepoFile from './repo_file';
import RepoLoadingFile from './repo_loading_file';
import RepoMiniMixin from './repo_mini_mixin';
export default class RepoSidebar {
constructor(url) {
......@@ -35,33 +35,30 @@ export default class RepoSidebar {
methods: {
addPopEventListener() {
window.addEventListener('popstate', () => {
if(location.href.indexOf('#') > -1) return;
if (location.href.indexOf('#') > -1) return;
this.linkClicked({
url: location.href
url: location.href,
});
});
},
linkClicked(file) {
console.log('link clicked')
let url = '';
if(typeof file === 'object') {
if(file.type === 'tree' && file.opened) {
if (typeof file === 'object') {
if (file.type === 'tree' && file.opened) {
Helper.removeChildFilesOfTree(file);
return;
} else {
url = file.url;
Service.url = url;
Helper.getContent(file);
}
} else if(typeof file === 'string') {
url = file.url;
Service.url = url;
Helper.getContent(file);
} else if (typeof file === 'string') {
// go back
url = file;
Service.url = url;
Helper.getContent();
}
}
},
},
});
}
}
\ No newline at end of file
}
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