Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ define([
return this;
},

/**
* Selects or deselects all records on the current page.
*
* @returns {Multiselect} Chainable.
*/
togglePage: function () {
return this.isPageSelected() ? this.deselectPage() : this.selectPage();
},

/**
* Clears the array of not selected records.
*
Expand Down
7 changes: 5 additions & 2 deletions app/code/Magento/Ui/view/base/web/js/grid/massactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,14 @@ define([
* invoked if action is confirmed.
*/
_confirm: function (action, callback) {
var confirmData = action.confirm;
var confirmData = action.confirm,
data = this.getSelections(),
total = data.total ? data.total : 0,
confirmMessage = confirmData.message + ' (' + total + ' record' + (total > 1 ? 's' : '') + ')';

confirm({
title: confirmData.title,
content: confirmData.message,
content: confirmMessage,
actions: {
confirm: callback
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
data-bind="
checked: allSelected(),
attr: {id: ++ko.uid},
event: { change: toggleSelectAll },
event: { change: togglePage },
css: { '_indeterminate': indetermine },
enable: totalRecords">
<label attr="for: ko.uid"/>
Expand Down