Commit 862702bf authored by Jacob Schatz's avatar Jacob Schatz Committed by Eric Eastwood

Make computed props.

parent a1ae5ec9
...@@ -41,6 +41,14 @@ const RepoFile = { ...@@ -41,6 +41,14 @@ const RepoFile = {
[this.file.icon] : !this.file.loading, [this.file.icon] : !this.file.loading,
}; };
return classObj; return classObj;
},
fileIndentation() {
return {'margin-left': this.file.level * 10 + 'px'};
},
activeFileClass() {
return {'active': this.activeFile.url === this.file.url};
} }
}, },
...@@ -55,9 +63,9 @@ export default RepoFile; ...@@ -55,9 +63,9 @@ export default RepoFile;
</script> </script>
<template> <template>
<tr class="file" v-if="canShowFile" :class="{'active': activeFile.url === file.url}" @click.prevent="linkClicked(file)"> <tr class="file" v-if="canShowFile" :class="activeFileClass" @click.prevent="linkClicked(file)">
<td> <td>
<i class="fa fa-fw" :class="fileIcon" :style="{'margin-left': file.level * 10 + 'px'}"></i> <i class="fa fa-fw" :class="fileIcon" :style="fileIndentation" aria-label="file icon"></i>
<a :href="file.url" class="repo-file-name" :title="file.url">{{file.name}}</a> <a :href="file.url" class="repo-file-name" :title="file.url">{{file.name}}</a>
</td> </td>
......
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