change new results hendlers

This commit is contained in:
zmagod 2017-05-12 10:02:33 +02:00
parent 81a3cb0a41
commit 070a829c49
2 changed files with 13 additions and 3 deletions

View file

@ -5,6 +5,7 @@
// New result asset behaviour
function initNewResultAsset() {
$('#new-result-asset').on('ajax:success', function(e, data) {
debugger;
var $form = $(data.html);
$('#results').prepend($form);

View file

@ -18,19 +18,28 @@
<span class="hidden-xs"><%= t'my_modules.results.add_label' %></span>
<% end %>
<% if can_create_result_text_in_module(@my_module) %>
<a class="btn btn-primary" id="new-result-text" href="<%= new_my_module_result_text_path(my_module_id: @my_module.id) %>" data-remote="true">
<a class="btn btn-primary"
id="new-result-text"
data-href="<%= new_my_module_result_text_path(my_module_id: @my_module.id) %>"
href="#">
<span class="glyphicon glyphicon-font"></span>
<span class="hidden-xs"><%= t("my_modules.results.new_text_result") %></span>
</a>
<% end %>
<% if can_create_result_table_in_module(@my_module) %>
<a class="btn btn-primary" id="new-result-table" href="<%= new_my_module_result_table_path(my_module_id: @my_module.id) %>" data-remote="true">
<a class="btn btn-primary"
id="new-result-table"
data-href="<%= new_my_module_result_table_path(my_module_id: @my_module.id) %>"
href="#">
<span class="glyphicon glyphicon-list-alt"></span>
<span class="hidden-xs"><%= t("my_modules.results.new_table_result") %></span>
</a>
<% end %>
<% if can_create_result_asset_in_module(@my_module) %>
<a class="btn btn-primary" id="new-result-asset" href="<%= new_my_module_result_asset_path(my_module_id: @my_module.id) %>" data-remote="true">
<a class="btn btn-primary"
id="new-result-asset"
data-href="<%= new_my_module_result_asset_path(my_module_id: @my_module.id) %>"
href="#">
<span class="glyphicon glyphicon-picture"></span>
<span class="hidden-xs"><%= t("my_modules.results.new_asset_result") %></span>
</a>