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

Fix repo_sidebar linting

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