Skip to content

Commit 48eaeab

Browse files
committed
MAGETWO-37555: Popup header is our of window range while creating group product
1 parent 463c715 commit 48eaeab

File tree

3 files changed

+13
-34
lines changed

3 files changed

+13
-34
lines changed

app/code/Magento/GroupedProduct/view/adminhtml/web/js/grouped-product.js

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ define([
77
'jquery',
88
'mage/template',
99
'jquery/ui',
10+
'Magento_Ui/js/modal/modal',
1011
'mage/translate',
11-
'mage/adminhtml/grid'
12+
'mage/adminhtml/grid',
13+
''
1214
], function ($, mageTemplate) {
1315
'use strict';
1416

@@ -94,7 +96,7 @@ define([
9496
},
9597

9698
/**
97-
* Create dialog for show product
99+
* Create modal for show product
98100
*
99101
* @private
100102
*/
@@ -103,48 +105,25 @@ define([
103105
selectedProductList = {},
104106
popup = $('[data-role=add-product-dialog]');
105107

106-
popup.dialog({
108+
popup.modal({
109+
type: 'slide',
110+
innerScroll: true,
107111
title: $.mage.__('Add Products to Group'),
108-
autoOpen: false,
109-
minWidth: 980,
110-
width: '75%',
111-
modal: true,
112-
resizable: true,
113-
dialogClass: 'grouped',
114-
position: {
115-
my: 'left top',
116-
at: 'center top',
117-
of: 'body'
118-
},
112+
modalClass: 'grouped',
119113
open: function () {
120-
$(this).closest('.ui-dialog').addClass('ui-dialog-active');
121-
122-
var topMargin = $(this).closest('.ui-dialog').children('.ui-dialog-titlebar').outerHeight() + 55;
123-
$(this).closest('.ui-dialog').css('margin-top', topMargin);
124-
125114
$(this).addClass('admin__scope-old'); // ToDo UI: remove with old styles removal
126115
},
127-
close: function () {
128-
$(this).closest('.ui-dialog').removeClass('ui-dialog-active');
129-
},
130116
buttons: [{
131117
id: 'grouped-product-dialog-apply-button',
132118
text: $.mage.__('Add Selected Products'),
133-
'class': 'action-primary action-add',
119+
class: 'action-primary action-add',
134120
click: function () {
135121
$.each(selectedProductList, function (index, product) {
136122
widget._add(null, product);
137123
});
138124
widget._resort();
139125
widget._updateGridVisibility();
140-
$(this).dialog('close');
141-
}
142-
}, {
143-
id: 'grouped-product-dialog-cancel-button',
144-
text: $.mage.__('Cancel'),
145-
'class': 'action-close',
146-
click: function () {
147-
$(this).dialog('close');
126+
popup.modal('closeModal');
148127
}
149128
}]
150129
});
@@ -186,7 +165,7 @@ define([
186165

187166
$('[data-role=add-product]').on('click', function (event) {
188167
event.preventDefault();
189-
popup.dialog('open');
168+
popup.modal('openModal');
190169
gridPopup.reload();
191170
selectedProductList = {};
192171
});

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Grouped/AssociatedProducts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AssociatedProducts extends Tab
3030
*
3131
* @var string
3232
*/
33-
protected $productSearchGrid = "./ancestor::body//div[div[contains(@data-role,'add-product-dialog')]]";
33+
protected $productSearchGrid = "./ancestor::body//div[div[div[contains(@data-role,'add-product-dialog')]]]";
3434

3535
/**
3636
* Associated products list block

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AssociatedProducts extends Tab
2929
*
3030
* @var string
3131
*/
32-
protected $productSearchGrid = "./ancestor::body//div[div[contains(@data-role,'add-product-dialog')]]";
32+
protected $productSearchGrid = "./ancestor::body//div[div[div[contains(@data-role,'add-product-dialog')]]]";
3333

3434
/**
3535
* Associated products list block

0 commit comments

Comments
 (0)