File tree 2 files changed +8
-2
lines changed
app/code/Magento/Catalog/view/adminhtml
templates/catalog/product/attribute
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ $stores = $block->getStoresSortedBySortOrder();
57
57
<input type="hidden" id="option-count-check" value="" />
58
58
</div>
59
59
<script id="row-template" type="text/x-magento-template">
60
- <tr>
60
+ <tr <% if (data.rowClasses) { %>class="<%- data.rowClasses %>"<% } %> >
61
61
<td class="col-draggable">
62
62
<?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
63
63
<div data-role="draggable-handle" class="draggable-handle"
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ define([
24
24
totalItems : 0 ,
25
25
rendered : 0 ,
26
26
template : mageTemplate ( '#row-template' ) ,
27
+ newOptionClass : 'new-option' ,
27
28
isReadOnly : config . isReadOnly ,
28
29
add : function ( data , render ) {
29
30
var isNewOption = false ,
@@ -32,7 +33,8 @@ define([
32
33
if ( typeof data . id == 'undefined' ) {
33
34
data = {
34
35
'id' : 'option_' + this . itemCount ,
35
- 'sort_order' : this . itemCount + 1
36
+ 'sort_order' : this . itemCount + 1 ,
37
+ 'rowClasses' : this . newOptionClass
36
38
} ;
37
39
isNewOption = true ;
38
40
}
@@ -84,6 +86,10 @@ define([
84
86
this . totalItems -- ;
85
87
this . updateItemsCountField ( ) ;
86
88
}
89
+
90
+ if ( element . hasClassName ( this . newOptionClass ) ) {
91
+ element . remove ( ) ;
92
+ }
87
93
} ,
88
94
updateItemsCountField : function ( ) {
89
95
$ ( 'option-count-check' ) . value = this . totalItems > 0 ? '1' : '' ;
You can’t perform that action at this time.
0 commit comments