diff --git a/src/main/webapp/scripts/index.js b/src/main/webapp/scripts/index.js index a99f4e24e..ba95294ba 100644 --- a/src/main/webapp/scripts/index.js +++ b/src/main/webapp/scripts/index.js @@ -99,38 +99,16 @@ function renderProjects(data) { } else { var table = $( '' + - '' + '' + '' + + '' + '
NameLast Modified
' ).appendTo(container)[0]; var renderProject = function(project) { var tr = table.insertRow(table.rows.length); tr.className = "project"; - - $('') - .addClass("delete-project") - .attr("title","Delete this project") - .attr("href","") - .html("") - .click(function() { - if (window.confirm("Are you sure you want to delete project \"" + project.name + "\"?")) { - $.ajax({ - type: "POST", - url: "/command/delete-project", - data: { "project" : project.id }, - dataType: "json", - success: function (data) { - if (data && typeof data.code != 'undefined' && data.code == "ok") { - fetchProjects(); - } - } - }); - } - return false; - }).appendTo(tr.insertCell(tr.cells.length)); - + $('') .text(project.name) .attr("href", "/project.html?project=" + project.id) @@ -141,6 +119,28 @@ function renderProjects(data) { .addClass("last-modified") .appendTo(tr.insertCell(tr.cells.length)); + $('') + .addClass("delete-project") + .attr("title","Delete this project") + .attr("href","") + .html("") + .click(function() { + if (window.confirm("Are you sure you want to delete project \"" + project.name + "\"?")) { + $.ajax({ + type: "POST", + url: "/command/delete-project", + data: { "project" : project.id }, + dataType: "json", + success: function (data) { + if (data && typeof data.code != 'undefined' && data.code == "ok") { + fetchProjects(); + } + } + }); + } + return false; + }).appendTo(tr.insertCell(tr.cells.length)); + }; for (var i = 0; i < projects.length; i++) {