@@ -91,7 +91,7 @@ export default {
91
91
testOptions: [" parent" , " child" , " grandchild" ],
92
92
testModel: [],
93
93
mockImg: false ,
94
- counter: 0 ,
94
+ // counter: 6 ,
95
95
initialPosition: {x: 0 , y: 0 ,},
96
96
initialSize: {w: 0 ,h: 0 ,},
97
97
};
@@ -119,7 +119,7 @@ export default {
119
119
]),
120
120
// used in VueDraggableResizeable component
121
121
activeRouteArray () {
122
- // console.log("active route array method", this.routes[this.activeRoute]);
122
+ console .log (" active route array method" , this .routes [this .activeRoute ]);
123
123
return this .routes [this .activeRoute ];
124
124
},
125
125
// used to delete components
@@ -216,6 +216,7 @@ export default {
216
216
" updateActiveComponentChildrenValue" ,
217
217
" updateComponentPosition" ,
218
218
" updateStartingPosition" ,
219
+ " updateComponentLayer" ,
219
220
" updateStartingSize" ,
220
221
" updateComponentSize" ,
221
222
]),
@@ -303,11 +304,6 @@ export default {
303
304
this .componentMap [this .activeComponent ].y = y;
304
305
this .userImage ;
305
306
},
306
- // onLayer: function(z) {
307
- // this.activeComponentData.z = z;
308
- // // Want to change the "Z" of the component found in Routes[activeRoute][whatever the component is]
309
- // //have to do this via an action or it won't be preserved in our undo/redo
310
- // },
311
307
312
308
finishedDrag : function (x ,y ){
313
309
console .log (" FINISHED DRAGGING" )
@@ -374,34 +370,26 @@ export default {
374
370
this .updateActiveComponentChildrenValue (value);
375
371
// this.updateComponentChildrenMultiselectValue(value)
376
372
},
377
- handleLayer (e ){
373
+ handleLayer (e ) {
378
374
e .preventDefault ()
379
- console .log (' event object' , e .target .innerText )
380
- console .log (' Layer handled' )
381
-
382
- if (e .target .innerText === ' +' ){
383
- this .counter ++ ;
384
- // this.activeComponentData.z = z;
385
- }
386
- if (e .target .innerText === ' -' && this .counter > 0 ){
387
- this .counter -- ;
375
+ const payload = {
376
+ activeComponent: this .activeComponent ,
377
+ routeArray: this .routes [this .activeRoute ],
378
+ activeComponentData: this .activeComponentData ,
379
+ z: this .activeComponentData .z ,
388
380
}
389
- console .log (' counter' , this .counter )
390
- this .activeComponentData .z = this .counter ;
391
- this .componentMap [this .activeComponent ].z = this .counter ;
392
-
381
+ if (e .target .innerText === ' +' ) payload .z ++ ;
382
+ if (e .target .innerText === ' -' && payload .z > 0 ) payload .z -- ;
383
+ this .updateComponentLayer (payload)
393
384
},
394
385
// @dblclick.native="onDoubleClick(componentData)"
395
386
// onDoubleClick (compData) {
396
387
// this.setActiveComponent(compData.componentName)
397
388
// this.activeComponentData.isActive = true
398
389
// }
399
390
handleClick (event ){
400
- if (event .target .className === " component-display grid-bg" )
401
- {
402
- if (! (' ' === this .activeComponent )){
403
- this .setActiveComponent (' ' );
404
- }
391
+ if (event .target .className === " component-display grid-bg" ) {
392
+ if (! (' ' === this .activeComponent )) this .setActiveComponent (' ' );
405
393
}
406
394
}
407
395
}
0 commit comments