From 23611c8d54e22340b60fba3c9ed798a74e231b71 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sun, 2 Feb 2014 02:01:37 -0300 Subject: [PATCH] fix select all issue --- wise-webapp/src/main/webapp/css/mindmapList.less | 1 - wise-webapp/src/main/webapp/js/buttonActions.js | 1 + wise-webapp/src/main/webapp/js/mindmapList.js | 14 ++------------ wise-webapp/src/main/webapp/jsp/mindmapList.jsp | 8 +++++--- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/wise-webapp/src/main/webapp/css/mindmapList.less b/wise-webapp/src/main/webapp/css/mindmapList.less index 66619890..d8d013f2 100644 --- a/wise-webapp/src/main/webapp/css/mindmapList.less +++ b/wise-webapp/src/main/webapp/css/mindmapList.less @@ -166,7 +166,6 @@ table.tableTag td { padding-right: 3px; padding-top :0px; padding-bottom: 0px; - background-color: #000000; color: #ffffff; line-height: 15px; } diff --git a/wise-webapp/src/main/webapp/js/buttonActions.js b/wise-webapp/src/main/webapp/js/buttonActions.js index 4082d40d..186cea12 100644 --- a/wise-webapp/src/main/webapp/js/buttonActions.js +++ b/wise-webapp/src/main/webapp/js/buttonActions.js @@ -209,6 +209,7 @@ $(function () { $(this).addClass('active'); $('#foldersContainer .active i').addClass('icon-white'); + $('input:checkbox').prop('checked', false); // Reload the table data ... dataTable.fnReloadAjax("c/restful/maps/?q=" + $(this).attr('data-filter'), callbackOnTableInit, true); event.preventDefault(); diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index 26b81594..04d85ac4 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -39,18 +39,8 @@ $.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, fnCallbac }; jQuery.fn.dataTableExt.selectAllMaps = function () { - var total = $('.select input:checkbox[id!="selectAll"]').size(); - var selected = $('.select input:checked[id!="selectAll"]').size(); - if (selected < total) { - $('.select input:!checked[id!="selectAll"]').each(function () { - $(this).prop("checked", true); - }); - } - else { - $('.select input:!checked[id!="selectAll"]').each(function () { - $(this).prop("checked", false); - }); - } + var bool = $("input:checkbox[id='selectAll']").prop('checked'); + $("input:checkbox[id!='selectAll']").prop('checked', bool); updateStatusToolbar(); }; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 21aec077..4f34dbbf 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -108,9 +108,11 @@ $('#mindmapListTable_length select').attr("style", "width:60px;"); - $('input:checkbox[id="selectAll"]').click(function () { - $("#mindmapListTable").dataTableExt.selectAllMaps(); - }); + $('input:checkbox[id="selectAll"]').click( + function () { + $("#mindmapListTable").dataTableExt.selectAllMaps(); + } + ); // Hack for changing the pagination buttons ... $('#nPageBtn').click(function () {