Skip to content

Commit 609d13b

Browse files
committed
MAGETWO-37928: Cannot remove address on Customer create on Backend
- Fix Delete Address functionality
1 parent 6987006 commit 609d13b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/code/Magento/Ui/view/base/web/js/form/components/collection.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ define([
4545

4646
elem.activate();
4747

48-
this.trigger('update');
48+
this.bubble('update');
4949

5050
return this;
5151
},
@@ -151,11 +151,11 @@ define([
151151
* Since this method is used by 'click' binding,
152152
* it requires function to invoke.
153153
*/
154-
removeChild: function (elem) {
154+
removeAddress: function (elem) {
155155
var confirmed = confirm(this.removeMessage);
156156

157157
if (confirmed) {
158-
this._removeChild(elem);
158+
this._removeAddress(elem);
159159
}
160160
},
161161

@@ -166,7 +166,7 @@ define([
166166
*
167167
* @param {Object} elem - Element to remove.
168168
*/
169-
_removeChild: function (elem) {
169+
_removeAddress: function (elem) {
170170
var isActive = elem.active(),
171171
first;
172172

@@ -178,7 +178,7 @@ define([
178178
first.activate();
179179
}
180180

181-
this.trigger('update');
181+
this.bubble('update');
182182
}
183183
});
184184
});

app/code/Magento/Ui/view/base/web/templates/form/components/collection.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!-- ko foreach: { data: element.elems, as: 'element' } -->
1111
<li class="address-list-item" data-bind="css: { 'ui-state-active': element.active }, click: activate">
1212
<div class="address-list-item-actions">
13-
<button class="action-delete" type="button" data-bind="click: $parent.removeChild.bind($parent, element)">
13+
<button class="action-delete" type="button" data-bind="click: $parent.removeAddress.bind($parent, element)">
1414
<span data-bind="text: $parent.removeLabel"></span>
1515
</button>
1616
</div>
@@ -42,4 +42,4 @@
4242
</div>
4343
</div>
4444
<!-- /ko -->
45-
</div>
45+
</div>

0 commit comments

Comments
 (0)