},
selected: function(e) {
- if (this.model.isDir()) {
- e.preventDefault();
- this.model.trigger('selected:dir', this.model);
- }
+ e.preventDefault();
+ this.model.trigger(this.model.isDir() ? 'selected:dir' : 'selected:file', this.model);
}
});
this.listenTo(this.path, 'selected', this.selectedPath);
this.listenTo(this.files, 'reset', this.resetFiles);
this.listenTo(this.files, 'selected:dir', this.selectedDir);
+ this.listenTo(this.files, 'selected:file', this.selectedFile);
// used in selectize callbacks
var view = this,
this.path.add({'text': dir.get('name'), 'path': dir.get('name')});
},
+ selectedFile: function(file) {
+ this.trigger('selected:file', this.host + this.path.full() + '/' + file.get('name'));
+ },
+
selectedPath: function(bit) {
var newPath = this.path.slice(0, this.path.indexOf(bit) + 1);
this.path.set(newPath);
<script src="{% static 'filex/filex.js' %}"></script>
<script>
- var app;
+ var filex;
$(function() {
- app = new Filex.FilexView({
+ filex = new Filex.FilexView({
host: 'qcg.man.poznan.pl',
hostOptions: [
{host: 'qcg.man.poznan.pl', path: '/home/plgrid/{{ request.user.username }}/reef'},
<script type="text/template" id="file-template">
<td class="text-center"><span class="glyphicon glyphicon-file" aria-hidden="true"></span></td>
<td>
- <a href="{% url 'filex:download' %}?<%= url_params %>" class="btn btn-default btn-xs pull-right link" title="Pobierz plik">
+ <a href="{% url 'filex:download' %}?<%= url_params %>"
+ class="btn btn-default btn-xs pull-right" title="Pobierz plik">
<span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span>
</a>
- <%= name %>
+ <a class="link" href="#"><%= name %></a>
</td>
<td class="text-right"><%= size %></td>
<td><%= date %></td>