[chronojump-server] Fixing the macro tasks table header



commit f01cb69c9810ea27ed002811598e8311d2b3ad0d
Author: Marcos Venteo <mventeo gmail com>
Date:   Tue Feb 13 22:21:57 2018 +0100

    Fixing the macro tasks table header

 chronojumpserver/templates/player_list.html |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/chronojumpserver/templates/player_list.html b/chronojumpserver/templates/player_list.html
index 7cda5cc..86c5017 100755
--- a/chronojumpserver/templates/player_list.html
+++ b/chronojumpserver/templates/player_list.html
@@ -213,7 +213,7 @@ $('#taskTypeTabs a').click(function (e) {
                $('#btnResetMacroTask').removeClass('hidden');
                var rowCount = $('#tasksTable tr').length;
                console.log(rowCount);
-               if (rowCount > 0) {
+               if (rowCount > 1) {
                        $('#btnAddMacroTask').removeClass('hidden');
 
                } else {
@@ -251,7 +251,7 @@ $('#btnResetMacroTask').click(function(e) {
 
 function removeMacroTasksTable() {
        console.log("Removing rows " + $('#tasksTable tr').length);
-       $('#tasksTable tr').remove();
+       $('.mTask').remove();
        $('#tasksTable').addClass("hidden");
        if (taskTypeInt == 1) {
                $('#btnCreateTasks').removeClass('hidden');
@@ -261,22 +261,22 @@ function removeMacroTasksTable() {
 
 
 function createTaskInTable(numTask) {
-       var html = "<tr>";
+       var html = "<tr class='mTask'>";
        var load = $('#taskLoad2').val();
        var speed = $('#taskSpeed2').val();
        $('#tasksTable').removeClass("hidden");
        var percentMaxSpeed = $('#taskpercentMaxSpeed2').val();
        html += "<td>" + (numTask + 1) + "</td>";
-       html += "<td><input class='macroLoad form-control' type='number' value=" + load + " /></td>";
+       html += "<td><input class='macroLoad form-control' type='number' value='" + load + "'/></td>";
        console.log(percentMaxSpeed);
        if (percentMaxSpeed == '') {
                html += "<td><input class='macroPercentMaxSpeed form-control' disabled type='number' /></td>";
        } else {
-               html += "<td><input class='macroPercentMaxSpeed form-control' type='number' value="+ 
percentMaxSpeed +"/></td>";
+               html += "<td><input class='macroPercentMaxSpeed form-control' type='number' value='"+ 
percentMaxSpeed + "' /></td>";
        }
-       html += "<td><input class='macroSpeed form-control' type='number' value=" + speed + " /></td>";
+       html += "<td><input class='macroSpeed form-control' type='number' value='" + speed + "' /></td>";
        html += "</tr>";
-       $('#tasksTable > tbody:last-child').append(html);
+       $('#tasksTable tr:last').after(html);
 }
 
 /* Function to add/Modify or delete a task called from Task Modal Form. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]