Skip to content

Commit 8b59433

Browse files
committed
#39640: Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear
- rolled back a file that was changed by mistake for another issue
1 parent 7be854d commit 8b59433

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright 2015 Adobe
3-
* All Rights Reserved.
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
44
*/
55

66
/**
@@ -355,11 +355,6 @@ define([
355355
imageData.isRemoved = true;
356356
$imageContainer.addClass('removed').hide().find('.is-removed').val(1);
357357

358-
$.each(this.options.types, $.proxy(function (index, type) {
359-
this.element.find('.image-' + type.code).val('no_selection');
360-
this.options.types[index].value = 'no_selection';
361-
}, this));
362-
363358
this._contentUpdated();
364359
},
365360

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2015 Adobe
3+
* All Rights Reserved.
44
*/
55

66
/**
@@ -691,12 +691,11 @@ define([
691691
processingAddChild: function (ctx, index, prop) {
692692
this.bubble('addChild', false);
693693

694-
if (this.relatedData.length && this.relatedData.length % this.pageSize === 0) {
695-
this.pages(this.pages() + 1);
696-
this.nextPage();
697-
} else if (~~this.currentPage() !== this.pages()) {
698-
this.currentPage(this.pages());
699-
}
694+
var newTotal = this.relatedData.length + 1;
695+
var newPages = Math.ceil(newTotal / this.pageSize);
696+
697+
this.pages(newPages);
698+
this.currentPage(newPages);
700699

701700
this.addChild(ctx, index, prop);
702701
},

0 commit comments

Comments
 (0)