From aa6d0da3fdcea4b1b4cf792d748f44350d59e496 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Thu, 27 Jul 2017 14:22:23 +0530 Subject: [PATCH 1/2] fixes wso2/product-iot#1243 --- .../public/js/dataTables.extended.js | 5 +++++ .../public/lib/theme-wso2_1.0/js/theme-wso2.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js index 411eecc39f..6fe390d62f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js @@ -255,6 +255,11 @@ $.fn.datatables_extended = function(settings){ $('body').on('click', '[data-type=selectable]', function(){ var rowSelectedClass = 'DTTT_selected selected'; $(this).toggleClass(rowSelectedClass); + if ($('.table-selectable .DTTT_selected').length > 0) { + $('.bulk-action-row').removeClass('hidden'); + } else { + $('.bulk-action-row').addClass('hidden'); + } var button = this, thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js index 21cfb7a654..aca2ccd3d0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/js/theme-wso2.js @@ -384,6 +384,11 @@ var responsiveTextRatio = 0.2, //Event for row select/deselect $('body').on('click', '[data-type=selectable]', function(){ $(this).toggleClass(ROW_SELECTED_CLASS); + if ($('.table-selectable .DTTT_selected').length > 0) { + $('.bulk-action-row').removeClass('hidden'); + } else { + $('.bulk-action-row').addClass('hidden'); + } var button = this, thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable(); From 4427348f69a58b615b12cdc1895632f52f634db0 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Thu, 27 Jul 2017 18:06:28 +0530 Subject: [PATCH 2/2] fixes wso2/product-iot#1243 --- .../public/js/dataTables.extended.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js index 6fe390d62f..31400687bc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js @@ -219,6 +219,7 @@ $.fn.datatables_extended = function(settings){ $(document).off('click','.viewEnabledIcon'); //--- End of EMM related codes } else if ($(button).html() == 'Cancel'){ + $('.bulk-action-row').addClass('hidden'); thisTable.removeClass("table-selectable"); $(button).addClass("active").html('Select'); $(button).parent().next().children().addClass("disabled");