File tree 3 files changed +10
-18
lines changed
ConfigurableProduct/view/adminhtml/web/js/components
Ui/view/base/web/js/dynamic-rows
3 files changed +10
-18
lines changed Original file line number Diff line number Diff line change @@ -219,19 +219,18 @@ define([
219
219
_ . each ( tmpData , function ( row , index ) {
220
220
path = this . dataScope + '.' + this . index + '.' + ( this . startIndex + index ) ;
221
221
row . attributes = $ ( '<i></i>' ) . text ( row . attributes ) . html ( ) ;
222
- row . sku = row . sku ;
223
222
this . source . set ( path , row ) ;
224
223
} , this ) ;
225
224
226
225
this . source . set ( this . dataScope + '.' + this . index , data ) ;
227
226
this . parsePagesData ( data ) ;
228
227
229
228
// Render
230
- dataCount = data . length ;
229
+ dataCount = tmpData . length ;
231
230
elemsCount = this . elems ( ) . length ;
232
231
233
232
if ( dataCount > elemsCount ) {
234
- this . getChildItems ( ) . each ( function ( elemData , index ) {
233
+ tmpData . each ( function ( elemData , index ) {
235
234
this . addChild ( elemData , this . startIndex + index ) ;
236
235
} , this ) ;
237
236
} else {
Original file line number Diff line number Diff line change @@ -1126,13 +1126,15 @@ define([
1126
1126
* Update whether value differs from default value
1127
1127
*/
1128
1128
setDifferedFromDefault : function ( ) {
1129
- var recordData = utils . copy ( this . recordData ( ) ) ;
1129
+ if ( this . default ) {
1130
+ var recordData = utils . copy ( this . recordData ( ) ) ;
1130
1131
1131
- Array . isArray ( recordData ) && recordData . forEach ( function ( item ) {
1132
- delete item [ 'record_id' ] ;
1133
- } ) ;
1132
+ Array . isArray ( recordData ) && recordData . forEach ( function ( item ) {
1133
+ delete item [ 'record_id' ] ;
1134
+ } ) ;
1134
1135
1135
- this . isDifferedFromDefault ( ! _ . isEqual ( recordData , this . default ) ) ;
1136
+ this . isDifferedFromDefault ( ! _ . isEqual ( recordData , this . default ) ) ;
1137
+ }
1136
1138
} ,
1137
1139
1138
1140
/**
Original file line number Diff line number Diff line change @@ -247,16 +247,7 @@ define([
247
247
* @returns {Object|Array } Cloned object.
248
248
*/
249
249
copy : function ( data ) {
250
- var result = data ,
251
- isArray = Array . isArray ( data ) ,
252
- placeholder ;
253
-
254
- if ( this . isObject ( data ) || isArray ) {
255
- placeholder = isArray ? [ ] : { } ;
256
- result = this . extend ( placeholder , data ) ;
257
- }
258
-
259
- return result ;
250
+ return _ . clone ( data )
260
251
} ,
261
252
262
253
/**
You can’t perform that action at this time.
0 commit comments