File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
app/code/Magento/Catalog/view/adminhtml/web/js Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments