Add folder icon for file viewer

This commit is contained in:
uu59 2014-06-16 11:08:55 +09:00
parent 6a5ffc49bc
commit 186d5a8462
2 changed files with 6 additions and 2 deletions

View File

@ -25,10 +25,13 @@
return _.find(this.paths, function(path){
return self.path == path.path;
});
},
}
},
methods: {
isAncestor: function(target) {
return this.path.indexOf(target) === 0;
},
fetchTree: function() {
var self = this;
new Promise(function(resolve, reject) {

View File

@ -2,7 +2,8 @@
<input type="text" name="<%= try(:name) %>" size="48" v-model="path" />
<div class="tree">
<pre>
<span v-on="click: selectPath(path)" class="vue-path" v-class="selected: isSelected(path)" v-repeat="paths">{{ path }}<span v-if="isSuffixRequired($data)">/</span>
<span v-on="click: selectPath(path)" class="vue-path" v-class="selected: isSelected(path)" v-repeat="paths"><span
v-if="is_dir"><span v-if="!isAncestor(path)"><%= icon("fa-folder") %></span><span v-if="isAncestor(path)"><%= icon("fa-folder-open") %></span></span>{{ path }}<span v-if="isSuffixRequired($data)">/</span>
</span></pre>
</div>