Skip to content

Commit 0611634

Browse files
author
Momotenko,Natalia(nmomotenko)
committed
Merge pull request #597 from magento-vanilla/PR
[Vanilla] Bugfixes + Story
2 parents 7a247b7 + cdf7c44 commit 0611634

File tree

10 files changed

+64
-22
lines changed

10 files changed

+64
-22
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ protected function getIsDeleteFieldConfig($sortOrder)
812812
'config' => [
813813
'componentType' => ActionDelete::NAME,
814814
'fit' => true,
815-
'sortOrder' => $sortOrder,
815+
'sortOrder' => $sortOrder
816816
],
817817
],
818818
],

app/code/Magento/Catalog/view/base/web/js/price-options.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ define([
2828
$.widget('mage.priceOptions', {
2929
options: globalOptions,
3030

31+
/**
32+
* @private
33+
*/
34+
_init: function initPriceBundle() {
35+
$(this.options.optionsSelector, this.element).trigger('change');
36+
},
37+
3138
/**
3239
* Widget creating method.
3340
* Triggered once.

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ define([
153153
generateAssociatedProducts: function () {
154154
var productsIds = [];
155155

156-
this.getUnionInsertData().each(function (data) {
156+
this.getUnionInsertData().forEach(function (data) {
157157
if (data.id !== null) {
158158
productsIds.push(data.id);
159159
}

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ define([
131131
drEl.instance = recordNode = this.processingStyles(recordNode, elem);
132132
drEl.instanceCtx = this.getRecord(originRecord[0]);
133133
drEl.eventMousedownY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY;
134-
drEl.minYpos =
135-
$table.offset().top - originRecord.offset().top +
136-
$table.outerHeight() - $table.find('tbody').outerHeight();
134+
drEl.minYpos = $table.offset().top - originRecord.offset().top + $table.find('thead').outerHeight();
137135
drEl.maxYpos = drEl.minYpos + $table.find('tbody').outerHeight() - originRecord.outerHeight();
138136
$tableWrapper.append(recordNode);
139137

@@ -185,9 +183,13 @@ define([
185183
/**
186184
* Mouse up handler
187185
*/
188-
mouseupHandler: function () {
186+
mouseupHandler: function (event) {
189187
var depElementCtx,
190-
drEl = this.draggableElement;
188+
drEl = this.draggableElement,
189+
pageY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY,
190+
positionY = pageY - drEl.eventMousedownY;
191+
192+
drEl.depElement = this.getDepElement(drEl.instance, positionY);
191193

192194
if (drEl.depElement) {
193195
depElementCtx = this.getRecord(drEl.depElement.elem[0]);
@@ -274,12 +276,12 @@ define([
274276
rec = collection.eq(i);
275277

276278
if (position === 'before') {
277-
rangeStart = collection.eq(i).position().top;
278-
rangeEnd = rangeStart + this.step;
279+
rangeStart = collection.eq(i).position().top - this.step;
280+
rangeEnd = rangeStart + this.step * 2;
279281
className = this.separatorsClass.top;
280282
} else if (position === 'after') {
281-
rangeEnd = rec.position().top + rec.height();
282-
rangeStart = rangeEnd - this.step;
283+
rangeEnd = rec.position().top + rec.height() + this.step;
284+
rangeStart = rangeEnd - this.step * 2;
283285
className = this.separatorsClass.bottom;
284286
}
285287

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows-grid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ define([
6464
* @returns {Object} Chainable.
6565
*/
6666
initChildren: function () {
67-
this.getChildItems().each(function (data, index) {
67+
this.getChildItems().forEach(function (data, index) {
6868
this.processingAddChild(data, this.startIndex + index, data[this.identificationDRProperty]);
6969
}, this);
7070

@@ -164,7 +164,7 @@ define([
164164
tmpObj = {};
165165

166166
if (data.length !== this.relatedData) {
167-
data.each(function (obj) {
167+
data.forEach(function (obj) {
168168
tmpObj[this.identificationDRProperty] = obj[this.identificationDRProperty];
169169

170170
if (!_.findWhere(this.relatedData, tmpObj)) {

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ define([
170170
* @returns {Object} Chainable.
171171
*/
172172
createHeaderTemplate: function (prop) {
173-
var visible = _.isUndefined(prop.visible) ? this.visible() : prop.visible,
173+
var visible = prop.visible !== false,
174174
disabled = _.isUndefined(prop.disabled) ? this.disabled() : prop.disabled;
175175

176176
return {

app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,26 @@ define([
110110
return this;
111111
},
112112

113+
/**
114+
* Gets first item index on current page.
115+
*
116+
* @returns {Number}
117+
*/
118+
getFirstItemIndex: function () {
119+
return this.pageSize * (this.current - 1) + 1;
120+
},
121+
122+
/**
123+
* Gets last item index on current page.
124+
*
125+
* @returns {Number}
126+
*/
127+
getLastItemIndex: function () {
128+
var lastItem = this.getFirstItemIndex() + this.pageSize - 1;
129+
130+
return this.totalRecords < lastItem ? this.totalRecords : lastItem;
131+
},
132+
113133
/**
114134
* Sets cursor to the provied value.
115135
*
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div class="admin__control-support-text">
8+
<!-- ko if: totalRecords -->
9+
<strong>
10+
<text args="getFirstItemIndex()"/> -
11+
<text args="getLastItemIndex()"/>
12+
</strong>
13+
<!-- ko i18n: 'of' --><!-- /ko -->
14+
<!-- /ko -->
15+
<strong text="totalRecords"/>
16+
<!-- ko i18n: 'records found' --><!-- /ko -->
17+
<!-- ko if: totalSelected -->
18+
(<text args="totalSelected"/> <!-- ko i18n: 'selected' --><!-- /ko -->)
19+
<!-- /ko -->
20+
</div>

app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205

206206
.admin__dynamic-rows {
207207
&._dragged {
208+
opacity: .95;
208209
position: absolute;
209210
z-index: 999;
210211
}

app/design/frontend/Magento/blank/web/js/responsive.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ define([
3838
galleryElement.gallery('option', 'showNav', false);
3939
galleryElement.gallery('option', 'showThumbs', true);
4040
}
41-
42-
setTimeout(function () {
43-
$('.product.data.items').tabs('option', 'openOnFocus', true);
44-
}, 500);
4541
},
4642
// Switch to Mobile Version
4743
exit: function () {
@@ -72,10 +68,6 @@ define([
7268
galleryElement.gallery('option', 'showThumbs', false);
7369
}
7470
}, 2000);
75-
76-
setTimeout(function () {
77-
$('.product.data.items').tabs('option', 'openOnFocus', false);
78-
}, 500);
7971
}
8072
});
8173
});

0 commit comments

Comments
 (0)