Skip to content

Commit 1239538

Browse files
committed
Merge remote-tracking branch 'mpchadwick/develop' into MAGETWO-36267
2 parents 10f06c6 + 8d259f3 commit 1239538

File tree

1 file changed

+6
-13
lines changed
  • app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute

1 file changed

+6
-13
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<td id="delete_button_container_<%- data.id %>" class="col-delete">
5959
<input type="hidden" class="delete-flag" name="option[delete][<%- data.id %>]" value="" />
6060
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
61-
<button title="<?php echo __('Delete') ?>" type="button"
61+
<button id="delete_button_<%- data.id %>" title="<?php echo __('Delete') ?>" type="button"
6262
class="action- scalable delete delete-option"
6363
>
6464
<span><?php echo __('Delete') ?></span>
@@ -100,7 +100,6 @@ require([
100100
if (isNewOption && !this.isReadOnly) {
101101
this.enableNewOptionDeleteButton(data.id);
102102
}
103-
this.bindRemoveButtons();
104103
this.itemCount++;
105104
this.totalItems++;
106105
this.updateItemsCountField();
@@ -139,22 +138,16 @@ require([
139138
button.removeClassName('disabled');
140139
});
141140
},
142-
bindRemoveButtons: function() {
143-
var buttons = $$('.delete-option');
144-
for (var i = 0; i < buttons.length; i++) {
145-
if (!$(buttons[i]).binded) {
146-
$(buttons[i]).binded = true;
147-
Event.observe(buttons[i], 'click', this.remove.bind(this));
148-
}
149-
}
150-
}
151141
};
152142

153-
attributeOption.bindRemoveButtons();
154-
155143
if ($('add_new_option_button')) {
156144
Event.observe('add_new_option_button', 'click', attributeOption.add.bind(attributeOption));
157145
}
146+
147+
$('manage-options-panel').on('click', '.delete-option', function(event, element) {
148+
attributeOption.remove(event);
149+
});
150+
158151
<?php foreach ($block->getOptionValues() as $_value): ?>
159152
attributeOption.add(<?php echo $_value->toJson() ?>);
160153
<?php endforeach; ?>

0 commit comments

Comments
 (0)