File tree Expand file tree Collapse file tree 3 files changed +10
-18
lines changed
ConfigurableProduct/view/adminhtml/web/js/components
Ui/view/base/web/js/dynamic-rows Expand file tree Collapse file tree 3 files changed +10
-18
lines changed Original file line number Diff line number Diff line change @@ -219,19 +219,18 @@ define([
219219 _ . each ( tmpData , function ( row , index ) {
220220 path = this . dataScope + '.' + this . index + '.' + ( this . startIndex + index ) ;
221221 row . attributes = $ ( '<i></i>' ) . text ( row . attributes ) . html ( ) ;
222- row . sku = row . sku ;
223222 this . source . set ( path , row ) ;
224223 } , this ) ;
225224
226225 this . source . set ( this . dataScope + '.' + this . index , data ) ;
227226 this . parsePagesData ( data ) ;
228227
229228 // Render
230- dataCount = data . length ;
229+ dataCount = tmpData . length ;
231230 elemsCount = this . elems ( ) . length ;
232231
233232 if ( dataCount > elemsCount ) {
234- this . getChildItems ( ) . each ( function ( elemData , index ) {
233+ tmpData . each ( function ( elemData , index ) {
235234 this . addChild ( elemData , this . startIndex + index ) ;
236235 } , this ) ;
237236 } else {
Original file line number Diff line number Diff line change @@ -1126,13 +1126,15 @@ define([
11261126 * Update whether value differs from default value
11271127 */
11281128 setDifferedFromDefault : function ( ) {
1129- var recordData = utils . copy ( this . recordData ( ) ) ;
1129+ if ( this . default ) {
1130+ var recordData = utils . copy ( this . recordData ( ) ) ;
11301131
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+ } ) ;
11341135
1135- this . isDifferedFromDefault ( ! _ . isEqual ( recordData , this . default ) ) ;
1136+ this . isDifferedFromDefault ( ! _ . isEqual ( recordData , this . default ) ) ;
1137+ }
11361138 } ,
11371139
11381140 /**
Original file line number Diff line number Diff line change @@ -247,16 +247,7 @@ define([
247247 * @returns {Object|Array } Cloned object.
248248 */
249249 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 )
260251 } ,
261252
262253 /**
You can’t perform that action at this time.
0 commit comments