diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-07-16 22:00:42 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-07-16 22:00:42 -0400 |
commit | 1e7ed83cbd2ddd58e8e60a4384eab011e23c22a6 (patch) | |
tree | 2cb5be0ac1c2bd522d7a2ba59916ddcc75dc9095 /data/assets | |
parent | 49a82a69d1cef4d067dcd6d4074dd77f86cfc332 (diff) | |
download | guff-1e7ed83cbd2ddd58e8e60a4384eab011e23c22a6.tar.bz2 guff-1e7ed83cbd2ddd58e8e60a4384eab011e23c22a6.zip |
add file api handler, enable admin page downloads
Diffstat (limited to 'data/assets')
-rw-r--r-- | data/assets/js/admin/tabs/files.js | 8 |
1 files changed, 6 insertions, 2 deletions
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}' ", ">", "<i class='fa fa-file-o'></i>", " ", @@ -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') { |