Skip to content

Commit

Permalink
Merge pull request #597 from magento-vanilla/PR
Browse files Browse the repository at this point in the history
[Vanilla] Bugfixes + Story
  • Loading branch information
Momotenko,Natalia(nmomotenko) committed May 11, 2016
2 parents 7a247b7 + cdf7c44 commit 0611634
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ protected function getIsDeleteFieldConfig($sortOrder)
'config' => [
'componentType' => ActionDelete::NAME,
'fit' => true,
'sortOrder' => $sortOrder,
'sortOrder' => $sortOrder
],
],
],
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/Catalog/view/base/web/js/price-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ define([
$.widget('mage.priceOptions', {
options: globalOptions,

/**
* @private
*/
_init: function initPriceBundle() {
$(this.options.optionsSelector, this.element).trigger('change');
},

/**
* Widget creating method.
* Triggered once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ define([
generateAssociatedProducts: function () {
var productsIds = [];

this.getUnionInsertData().each(function (data) {
this.getUnionInsertData().forEach(function (data) {
if (data.id !== null) {
productsIds.push(data.id);
}
Expand Down
20 changes: 11 additions & 9 deletions app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ define([
drEl.instance = recordNode = this.processingStyles(recordNode, elem);
drEl.instanceCtx = this.getRecord(originRecord[0]);
drEl.eventMousedownY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY;
drEl.minYpos =
$table.offset().top - originRecord.offset().top +
$table.outerHeight() - $table.find('tbody').outerHeight();
drEl.minYpos = $table.offset().top - originRecord.offset().top + $table.find('thead').outerHeight();
drEl.maxYpos = drEl.minYpos + $table.find('tbody').outerHeight() - originRecord.outerHeight();
$tableWrapper.append(recordNode);

Expand Down Expand Up @@ -185,9 +183,13 @@ define([
/**
* Mouse up handler
*/
mouseupHandler: function () {
mouseupHandler: function (event) {
var depElementCtx,
drEl = this.draggableElement;
drEl = this.draggableElement,
pageY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY,
positionY = pageY - drEl.eventMousedownY;

drEl.depElement = this.getDepElement(drEl.instance, positionY);

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

if (position === 'before') {
rangeStart = collection.eq(i).position().top;
rangeEnd = rangeStart + this.step;
rangeStart = collection.eq(i).position().top - this.step;
rangeEnd = rangeStart + this.step * 2;
className = this.separatorsClass.top;
} else if (position === 'after') {
rangeEnd = rec.position().top + rec.height();
rangeStart = rangeEnd - this.step;
rangeEnd = rec.position().top + rec.height() + this.step;
rangeStart = rangeEnd - this.step * 2;
className = this.separatorsClass.bottom;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ define([
* @returns {Object} Chainable.
*/
initChildren: function () {
this.getChildItems().each(function (data, index) {
this.getChildItems().forEach(function (data, index) {
this.processingAddChild(data, this.startIndex + index, data[this.identificationDRProperty]);
}, this);

Expand Down Expand Up @@ -164,7 +164,7 @@ define([
tmpObj = {};

if (data.length !== this.relatedData) {
data.each(function (obj) {
data.forEach(function (obj) {
tmpObj[this.identificationDRProperty] = obj[this.identificationDRProperty];

if (!_.findWhere(this.relatedData, tmpObj)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ define([
* @returns {Object} Chainable.
*/
createHeaderTemplate: function (prop) {
var visible = _.isUndefined(prop.visible) ? this.visible() : prop.visible,
var visible = prop.visible !== false,
disabled = _.isUndefined(prop.disabled) ? this.disabled() : prop.disabled;

return {
Expand Down
20 changes: 20 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/grid/paging/paging.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@ define([
return this;
},

/**
* Gets first item index on current page.
*
* @returns {Number}
*/
getFirstItemIndex: function () {
return this.pageSize * (this.current - 1) + 1;
},

/**
* Gets last item index on current page.
*
* @returns {Number}
*/
getLastItemIndex: function () {
var lastItem = this.getFirstItemIndex() + this.pageSize - 1;

return this.totalRecords < lastItem ? this.totalRecords : lastItem;
},

/**
* Sets cursor to the provied value.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div class="admin__control-support-text">
<!-- ko if: totalRecords -->
<strong>
<text args="getFirstItemIndex()"/> -
<text args="getLastItemIndex()"/>
</strong>
<!-- ko i18n: 'of' --><!-- /ko -->
<!-- /ko -->
<strong text="totalRecords"/>
<!-- ko i18n: 'records found' --><!-- /ko -->
<!-- ko if: totalSelected -->
(<text args="totalSelected"/> <!-- ko i18n: 'selected' --><!-- /ko -->)
<!-- /ko -->
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@

.admin__dynamic-rows {
&._dragged {
opacity: .95;
position: absolute;
z-index: 999;
}
Expand Down
8 changes: 0 additions & 8 deletions app/design/frontend/Magento/blank/web/js/responsive.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ define([
galleryElement.gallery('option', 'showNav', false);
galleryElement.gallery('option', 'showThumbs', true);
}

setTimeout(function () {
$('.product.data.items').tabs('option', 'openOnFocus', true);
}, 500);
},
// Switch to Mobile Version
exit: function () {
Expand Down Expand Up @@ -72,10 +68,6 @@ define([
galleryElement.gallery('option', 'showThumbs', false);
}
}, 2000);

setTimeout(function () {
$('.product.data.items').tabs('option', 'openOnFocus', false);
}, 500);
}
});
});

0 comments on commit 0611634

Please sign in to comment.