File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
app/code/Magento/Catalog/view/adminhtml
templates/catalog/product/attribute Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ $stores = $block->getStoresSortedBySortOrder();
5757 <input type="hidden" id="option-count-check" value="" />
5858 </div>
5959 <script id="row-template" type="text/x-magento-template">
60- <tr>
60+ <tr <% if (data.rowClasses) { %>class="<%- data.rowClasses %>"<% } %> >
6161 <td class="col-draggable">
6262 <?php if (!$ block ->getReadOnly () && !$ block ->canManageOptionDefaultOnly ()): ?>
6363 <div data-role="draggable-handle" class="draggable-handle"
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ define([
2424 totalItems : 0 ,
2525 rendered : 0 ,
2626 template : mageTemplate ( '#row-template' ) ,
27+ newOptionClass : 'new-option' ,
2728 isReadOnly : config . isReadOnly ,
2829 add : function ( data , render ) {
2930 var isNewOption = false ,
@@ -32,7 +33,8 @@ define([
3233 if ( typeof data . id == 'undefined' ) {
3334 data = {
3435 'id' : 'option_' + this . itemCount ,
35- 'sort_order' : this . itemCount + 1
36+ 'sort_order' : this . itemCount + 1 ,
37+ 'rowClasses' : this . newOptionClass
3638 } ;
3739 isNewOption = true ;
3840 }
@@ -84,6 +86,10 @@ define([
8486 this . totalItems -- ;
8587 this . updateItemsCountField ( ) ;
8688 }
89+
90+ if ( element . hasClassName ( this . newOptionClass ) ) {
91+ element . remove ( ) ;
92+ }
8793 } ,
8894 updateItemsCountField : function ( ) {
8995 $ ( 'option-count-check' ) . value = this . totalItems > 0 ? '1' : '' ;
You can’t perform that action at this time.
0 commit comments