Skip to content
This repository has been archived by the owner on May 26, 2018. It is now read-only.

Commit

Permalink
UI files list context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ikit committed Nov 24, 2016
1 parent 745e6e9 commit 6c7c45c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pirus/api_rest/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h1>Goals of Pirus</h1>
<!-- FILES LIST -->
<!-- -->
<div id="browser_files">
<table id="browser_inprogress_files_table" class="table table-striped table-bordered" cellspacing="0" width="100%" style="margin:0">
<table id="browser_files_table" class="table table-striped table-bordered" cellspacing="0" width="100%" style="margin:0">
<thead>
<tr>
<th></th>
Expand All @@ -250,6 +250,7 @@ <h1>Goals of Pirus</h1>
<th>Creation</th>
<th class="collapse">Comments</th>
<th class="collapse">Tags</th>
<th class="collapse">Id</th>
</tr>
</thead>
<tbody>
Expand All @@ -272,6 +273,7 @@ <h1>Goals of Pirus</h1>
<td>{{ f["create_date"] }}</td>
<td class="collapse">{{ f["comments"] }}</td>
<td class="collapse">{% for t in f["tags"] %}{{t}}{% endfor %}</td>
<td class="collapse">{{ f["id"]}}</td>
</tr>
{% endfor %}
</tbody>
Expand Down Expand Up @@ -420,10 +422,9 @@ <h3 id="browser_file_name" style="margin-left: 20px;"></h3>
</div>


<ul id="contextMenu" class="dropdown-menu" role="menu" style="display:none" >
<li><a tabindex="-1" href="#"><i class="fa fa-info-circle" aria-hidden="true"></i> Informations</a></li>
<li><a tabindex="-1" href="#"><i class="fa fa-cloud-download" aria-hidden="true"></i> Download</a></li>
<li><a tabindex="-1" href="#"><i class="fa fa-times" aria-hidden="true"></i> Delete</a></li>
<ul id="context_menu" class="dropdown-menu" role="menu" style="display:none" >
<li><a id="context_menu_info" tabindex="-1" href="#"><i class="fa fa-info-circle" aria-hidden="true"></i> Informations</a></li>
<li><a id="context_menu_dl" tabindex="-1" href="#"><i class="fa fa-cloud-download" aria-hidden="true"></i> Download</a></li>
</ul>


Expand Down Expand Up @@ -622,11 +623,13 @@ <h4 class="modal-title"><i class="fa fa-play" aria-hidden="true"></i> New <span
update_datagrid();

$("#browser_files_table td").contextMenu({
menuSelector: "#contextMenu",
menuSelected: function (invokedOn, selectedMenu) {
var msg = "You selected the menu item '" + selectedMenu.text() +
"' on the value '" + invokedOn.text() + "'";
alert(msg);
menuSelector: "#context_menu",
menuSelected: function (invokedOn, selectedMenu)
{
var action = selectedMenu[0].getAttribute("id");
var id = invokedOn[0].parentElement.children[6].innerHTML;
if (action == "context_menu_info") show_tab("browser_file", id);
else if (action == "context_menu_dl") alert("TODO : download the file " + id);
}
});

Expand Down Expand Up @@ -673,7 +676,6 @@ <h4 class="modal-title"><i class="fa fa-play" aria-hidden="true"></i> New <span
.off('click')
.on('click', 'a', function (e) {
$menu.hide();

var $invokedOn = $menu.data("invokedOn");
var $selectedMenu = $(e.target);

Expand Down

0 comments on commit 6c7c45c

Please sign in to comment.