@@ -207,10 +207,10 @@ const mutations = {
207
207
} ;
208
208
} ,
209
209
// //add binding
210
- [ types . ADD_BINDING ] : ( state , payload ) => {
210
+ [ types . addBindingText ] : ( state , payload ) => {
211
211
//access the htmlList, add payload to the empty bind obj
212
212
//state.component
213
- console . log ( state . componentMap [ state . activeComponenet ] )
213
+ console . log ( state . componentMap [ state . activeComponent ] )
214
214
} ,
215
215
[ types . DELETE_ACTION_FROM_COMPONENT ] : ( state , payload ) => {
216
216
state . componentMap [ state . activeComponent ] . actions = state . componentMap [ state . activeComponent ] . actions . filter (
@@ -393,7 +393,8 @@ const mutations = {
393
393
text : payload . elementName ,
394
394
id : payload . date ,
395
395
children : [ ] ,
396
- class : ''
396
+ class : '' ,
397
+ binding : ""
397
398
} ) ;
398
399
} ,
399
400
@@ -492,25 +493,25 @@ const mutations = {
492
493
const idDrag = state . componentMap [ componentName ] . idDrag ;
493
494
const idDrop = state . componentMap [ componentName ] . idDrop ;
494
495
495
- if ( idDrag !== idDrop && idDrag !== '' && idDrop !== '' ) {
496
+ if ( idDrag !== idDrop && idDrag !== '' && idDrop !== '' ) {
496
497
let indexDrag ;
497
498
let indexDrop ;
498
499
const htmlList = state . componentMap [ componentName ] . htmlList . slice ( 0 )
499
500
500
501
if ( state . activeLayer . id === "" ) {
501
502
htmlList . forEach ( ( el , i ) => {
502
- if ( el . id === idDrag ) {
503
+ if ( el . id === idDrag ) {
503
504
indexDrag = i ;
504
- } else if ( el . id === idDrop ) {
505
+ } else if ( el . id === idDrop ) {
505
506
indexDrop = i ;
506
507
}
507
508
} )
508
509
const draggedEl = htmlList . splice ( indexDrag , 1 ) [ 0 ]
509
- htmlList . splice ( indexDrop , 0 , draggedEl )
510
+ htmlList . splice ( indexDrop , 0 , draggedEl )
510
511
} else {
511
512
const nestedDrag = breadthFirstSearchParent ( htmlList , idDrag ) ;
512
513
const nestedDrop = breadthFirstSearchParent ( htmlList , idDrop ) ;
513
- let nestedEl = nestedDrag . evaluated . children . splice ( nestedDrag . index , 1 ) [ 0 ]
514
+ let nestedEl = nestedDrag . evaluated . children . splice ( nestedDrag . index , 1 ) [ 0 ]
514
515
nestedDrop . evaluated . children . splice ( nestedDrop . index , 0 , nestedEl )
515
516
}
516
517
state . componentMap [ componentName ] . htmlList = htmlList ;
@@ -523,22 +524,22 @@ const mutations = {
523
524
const selectedIdDrag = state . selectedIdDrag ;
524
525
const selectedIdDrop = state . selectedIdDrop ;
525
526
526
- if ( selectedIdDrag !== selectedIdDrop && selectedIdDrag !== '' && selectedIdDrop !== '' ) {
527
+ if ( selectedIdDrag !== selectedIdDrop && selectedIdDrag !== '' && selectedIdDrop !== '' ) {
527
528
const htmlList = state . selectedElementList . slice ( 0 )
528
529
529
530
let indexDrag ;
530
531
let indexDrop ;
531
532
532
533
htmlList . forEach ( ( el , i ) => {
533
- if ( el . id === selectedIdDrag ) {
534
+ if ( el . id === selectedIdDrag ) {
534
535
indexDrag = i ;
535
- } else if ( el . id === selectedIdDrop ) {
536
+ } else if ( el . id === selectedIdDrop ) {
536
537
indexDrop = i ;
537
538
}
538
539
} )
539
540
540
541
const draggedEl = htmlList . splice ( indexDrag , 1 ) [ 0 ]
541
- htmlList . splice ( indexDrop , 0 , draggedEl )
542
+ htmlList . splice ( indexDrop , 0 , draggedEl )
542
543
state . selectedElementList = htmlList ;
543
544
}
544
545
state . selectedIdDrag = '' ;
@@ -720,7 +721,7 @@ const mutations = {
720
721
721
722
updatedComponent . color = payload . color
722
723
} ,
723
- //Attribute updater for parent
724
+ //Attribute updater for parent
724
725
[ types . EDIT_ATTRIBUTE ] : ( state , payload ) => {
725
726
const updatedComponent = state . routes [ state . activeRoute ] . filter (
726
727
( element ) => element . componentName === payload . activeComponent
0 commit comments