Skip to content

Commit d8d0ad3

Browse files
committed
MAGETWO-37596: Stabilize story after testing
1 parent 52ad623 commit d8d0ad3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/new-category-dialog.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ define([
5656
type: 'slide',
5757
modalClass: 'mage-new-category-dialog form-inline',
5858
title: $.mage.__('Create Category'),
59+
opened: function () {
60+
var enteredName = $('#category_ids-suggest').val();
61+
62+
$('#new_category_name').val(enteredName);
63+
if (enteredName === '') {
64+
$('#new_category_name').focus();
65+
}
66+
$('#new_category_messages').html('');
67+
},
68+
closed: function () {
69+
var validationOptions = newCategoryForm.validation('option');
70+
71+
$('#new_category_name, #new_category_parent-suggest').val('');
72+
validationOptions.unhighlight($('#new_category_parent-suggest').get(0),
73+
validationOptions.errorClass, validationOptions.validClass || '');
74+
newCategoryForm.validation('clearError');
75+
$('#category_ids-suggest').focus();
76+
},
5977
buttons: [{
6078
text: $.mage.__('Create Category'),
6179
class: 'action-primary',

0 commit comments

Comments
 (0)