From 1e7ed83cbd2ddd58e8e60a4384eab011e23c22a6 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 16 Jul 2016 22:00:42 -0400 Subject: add file api handler, enable admin page downloads --- data/assets/js/admin/tabs/files.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'data/assets/js/admin') diff --git a/data/assets/js/admin/tabs/files.js b/data/assets/js/admin/tabs/files.js index c3737d0..82af4b4 100644 --- a/data/assets/js/admin/tabs/files.js +++ b/data/assets/js/admin/tabs/files.js @@ -10,6 +10,7 @@ jQuery(function($) { "data-name='%{name|h}' ", "data-size='%{size|h}' ", "data-path='%{path|h}' ", + "data-url='%{url|h}' ", ">", "", " ", @@ -130,7 +131,7 @@ jQuery(function($) { } else { // select and download file $(this).click(); - $('#files-download').click(); + $('#file-actions a[data-id="download"]').click(); } // stop event @@ -164,7 +165,10 @@ jQuery(function($) { $('body').trigger('click'); if (data.id == 'download') { - alert('TODO: download file'); + // alert('TODO: download file'); + var url = $('#files .active').data('url'); + if (url) + location.href = url; } else if (data.id == 'move') { alert('TODO: move file'); } else if (data.id == 'delete') { -- cgit v1.2.3