add download link to editor

This commit is contained in:
Min RK 2015-02-02 16:35:24 -08:00
parent 95ac0675c9
commit 23fad40f6d
2 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,11 @@ define([
this.element.find('#rename-file').click(function () {
that.save_widget.rename();
});
this.element.find('#download-file').click(function () {
window.open(utils.url_join_encode(
that.base_url, 'files', that.editor.file_path
) + '?download=1');
});
// Edit
this.element.find('#menu-find').click(function () {

View File

@ -48,6 +48,7 @@ data-file-path="{{file_path}}"
<li id="new-file"><a href="#">New</a></li>
<li id="save-file"><a href="#">Save</a></li>
<li id="rename-file"><a href="#">Rename</a></li>
<li id="download-file"><a href="#">Download</a></li>
</ul>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a>