Fix collission with sortable.js script

TableSortable and Sortable javascripts were using the same CSS
class name to define completely different and separated
behaviours causing unexpected errors. Now `sortable.js` script
will use `.sortable` class and `table_sortable.js` will use
`.table-sortable` instead.
This commit is contained in:
Senén Rodero Rodríguez
2020-07-28 11:15:09 +02:00
parent cda545f2fc
commit 99f8bb4491
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@
}; };
}, },
initialize: function() { initialize: function() {
$("table.sortable th").on("click", function() { $(".table-sortable th").on("click", function() {
var rows, table; var rows, table;
table = $(this).parents("table").eq(0); table = $(this).parents("table").eq(0);
rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index())); rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index()));

View File

@@ -25,7 +25,7 @@
</div> </div>
<h2><%= t("admin.stats.polls.all") %></h2> <h2><%= t("admin.stats.polls.all") %></h2>
<table id="polls" class="stack sortable"> <table id="polls" class="stack table-sortable">
<thead> <thead>
<tr> <tr>
<th><%= t("admin.stats.polls.table.poll_name") %></th> <th><%= t("admin.stats.polls.table.poll_name") %></th>
@@ -52,7 +52,7 @@
<h3 id="<%= dom_id(poll) %>_questions"> <h3 id="<%= dom_id(poll) %>_questions">
<%= t("admin.stats.polls.poll_questions", poll: poll.name) %> <%= t("admin.stats.polls.poll_questions", poll: poll.name) %>
</h3> </h3>
<table class="stack sortable"> <table class="stack table-sortable">
<thead> <thead>
<tr> <tr>
<th><%= t("admin.stats.polls.table.question_name") %></th> <th><%= t("admin.stats.polls.table.question_name") %></th>