🎨 Site > File Tree > Remove data property

This commit is contained in:
brunosimon
2017-08-29 20:30:33 +01:00
parent 9576c4782d
commit e9f373e62e
7 changed files with 40 additions and 28 deletions
@@ -35,7 +35,7 @@ export default
if(search !== '')
{
// Set up fuzzy search
const text = this.content.data.path.full.replace(/^\.\//, '')
const text = this.content.path.full.replace(/^\.\//, '')
let searchPosition = 0
this.matchingPositions = []
@@ -46,7 +46,7 @@ export default
if(searchPosition < search.length && text[n].toLowerCase() === search[searchPosition])
{
searchPosition += 1
this.matchingPositions.push(n - this.content.data.path.directory.length + 1)
this.matchingPositions.push(n - this.content.path.directory.length + 1)
}
}
@@ -64,7 +64,7 @@ export default
{
onNameClick()
{
this.$store.commit('setFile', this.content.data.path.full)
this.$store.commit('setFile', this.content.path.full)
}
}
}
@@ -1,12 +1,12 @@
<div v-show="visible">
<a href="#" class="name" :style="{ paddingLeft:depth * 20 + 'px' }" @click.prevent="onNameClick">
<file-icon class="icon" :extension="content.data.extension"></file-icon>
<file-icon class="icon" :extension="content.extension"></file-icon>
<span class="text">
<template v-for="(letter, key) in content.name">
<span :style="matchingPositions.indexOf(key) !== -1 ? 'font-weight:bold;' : ''">{{ letter }}</span>
</template>
</span>
<span v-if="content.data.isNew" class="new">(new)</span>
<span v-if="content.data.isChanged && !content.data.isNew" class="changed">(changed)</span>
<span v-if="content.isNew" class="new">(new)</span>
<span v-if="content.isChanged && !content.isNew" class="changed">(changed)</span>
</a>
</div>
@@ -10,6 +10,6 @@
</a>
<div v-show="open">
<files-tree-folder class="js-child" v-for="folder of content.folders" :key="folder.name" :content="folder" :depth="depth + 1" :directory="fullPath + '/'"></files-tree-folder>
<files-tree-file class="js-child" v-for="file of files" :key="file.data.path.full" :content="file" :depth="depth + 1"></files-tree-file>
<files-tree-file class="js-child" v-for="file of files" :key="file.path.full" :content="file" :depth="depth + 1"></files-tree-file>
</div>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
{{ project.name }}
<files-tree></files-tree>
<file v-if="file" :content="file.data"></file>
<file v-if="file" :content="file"></file>
<landing v-if="!file"></landing>
<chat></chat>
<alert></alert>
+1 -1
View File
@@ -15,7 +15,7 @@ export default
{
extension()
{
return this.$store.state.files.current.data.extension
return this.$store.state.files.current.extension
},
version()