From 391c523b43aadba58921e14a486747b135de120d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 23 May 2012 01:13:00 -0300 Subject: [PATCH] Finish delete operation. --- wise-webapp/src/main/webapp/js/mymaps.js | 21 +++++-------------- .../src/main/webapp/jsp/mindmapList.jsp | 7 ++----- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mymaps.js b/wise-webapp/src/main/webapp/js/mymaps.js index a55cf28a..33460bfe 100644 --- a/wise-webapp/src/main/webapp/js/mymaps.js +++ b/wise-webapp/src/main/webapp/js/mymaps.js @@ -49,20 +49,9 @@ jQuery.fn.dataTableExt.getSelectedRows = function() { }; jQuery.fn.dataTableExt.removeSelectedRows = function() { - var mapIds = this.getSelectedMapsIds(); var trs = this.getSelectedRows(); - jQuery.ajax({ - async:false, - url: "../service/maps/batch?ids=" + mapIds.join(","), - type:"DELETE", - success : function(data, textStatus, jqXHR) { - trs.each(function() { - $('#mindmapListTable').dataTable().fnDeleteRow(this); - }); - }, - error: function() { - alert("Unexpected error removing maps. Refresh before continue."); - } + trs.each(function() { + $('#mindmapListTable').dataTable().fnDeleteRow(this); }); }; @@ -85,6 +74,7 @@ jQuery.fn.dialogForm = function(options) { formData[elem.name] = elem.value; }); + var dialogElem = this; jQuery.ajax(url, { async:false, dataType: 'json', @@ -100,9 +90,9 @@ jQuery.fn.dialogForm = function(options) { window.location = redirectUrl; } else if (options.postUpdate) { - options.postUpdate(formData); } + dialogElem.modal('hide'); }, error: function(jqXHR, textStatus, errorThrown) { if (jqXHR.status == 400) { @@ -134,7 +124,7 @@ jQuery.fn.dialogForm = function(options) { }.bind(this)); // Open the modal dialog ... - this.modal(options); + this.modal(); }; @@ -146,7 +136,6 @@ function updateStatus() { $("#mindmapListTable tbody input:checked").parent().parent().addClass('row-selected'); $("#mindmapListTable tbody input:not(:checked)").parent().parent().removeClass('row-selected'); - // Update toolbar ... $("#buttonsToolbar .act-multiple").hide(); $("#buttonsToolbar .act-single").hide(); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 08c6a113..d6a64389 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -77,7 +77,8 @@ bAutoWidth : false, oLanguage : { "sSearch" : "", - "sInfo" : "_START_-_END_ of _TOTAL_" + "sInfo" : "_START_-_END_ of _TOTAL_", + "sEmptyTable": "Hey, you don't have any mindmap. Go head and create one clicking the 'New' button !!!" }, bStateSave:true }); @@ -115,7 +116,6 @@ $("#newBtn").click( function() { $("#new-dialog-modal").dialogForm({ - modal: true, redirect: "c/map/{header.resourceId}/edit.htm", url : "../service/maps" }); @@ -140,7 +140,6 @@ // Initialize dialog ... $("#duplicate-dialog-modal").dialogForm({ - modal: true, redirect: "c/map/{header.resourceId}/edit.htm", url : "../service/maps/" + mapId }); @@ -167,7 +166,6 @@ // Initialize dialog ... $("#rename-dialog-modal").dialogForm({ - modal: true, type: 'PUT', postUpdate: function(reqBodyData) { // Remove old entry ... @@ -190,7 +188,6 @@ if (mapIds.length > 0) { // Initialize dialog ... $("#delete-dialog-modal").dialogForm({ - modal: true, type: 'DELETE', postUpdate: function(reqBodyData) { // Remove old entry ...