- $selectionGrid.modal({
- title: $optionBox.find('input[name$="[title]"]').val() === '' ?
- $.mage.__('Add Products to New Option') :
- $.mage.__('Add Products to Option "%1"').replace(
- '%1',
- $('<div>').text($optionBox.find('input[name$="[title]"]').val()).html()
- ),
- modalClass: 'bundle',
- type: 'slide',
-
- /**
- * @param {jQuery.Event} e
- * @param {Object} modalWindow
- */
- closed: function (e, modalWindow) {
- modalWindow.modal.remove();
- },
- buttons: [{
- text: $.mage.__('Add Selected Products'),
- 'class': 'action-primary action-add',
-
- /** Click action. */
- click: function () {
- $.each(selectedProductList, function () {
- window.bSelection.addRow(optionIndex, this);
- });
- bSelection.gridRemoval.each(function (pair) {
- $optionBox.find('.col-sku').filter(function () {
- return $.trim($(this).text()) === pair.key; // find row by SKU
- }).closest('tr').find('button.delete').trigger('click');
- });
- widget.refreshSortableElements();
- widget._updateSelectionsPositions.apply(widget.element);
- $selectionGrid.modal('closeModal');
- }
- }]
- });