Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Hide 'n items selected' text if no items selected

dominik-zeglen80b72769b611
diff --git a/saleor/static/dashboard/js/components/bulk-actions.js b/saleor/static/dashboard/js/components/bulk-actions.js
index 8185ffba51..3597b441cd 100644
--- a/saleor/static/dashboard/js/components/bulk-actions.js
+++ b/saleor/static/dashboard/js/components/bulk-actions.js
@@ -1,6 +1,12 @@
function updateCounterSelected () {
const count = $('.select-item:checked').length;
- $('.data-table-header-action-selected-items #counter').text(count);
+ const counterText = $('.data-table-header-action-selected-items');
+ $('#counter').text(count);
+ if (!count) {
+ counterText.addClass('hide');
+ } else {
+ counterText.removeClass('hide');
+ }
}
$(document).ready((e) => {
diff --git a/templates/dashboard/product/list.html b/templates/dashboard/product/list.html
index 5c3efa9bac..1511886ce0 100644
--- a/templates/dashboard/product/list.html
+++ b/templates/dashboard/product/list.html
@@ -58,7 +58,7 @@
</div>
<div class="row">
<div class="col s12">
- <div class="data-table-header-action-selected-items col inline">
+ <div class="data-table-header-action-selected-items col inline hide">
<span id="counter">0</span> {% trans "item(s) selected" context "Dashboard bulk action summary" %}
</div>
</div>