Skip to content

Commit a860975

Browse files
committed
before merge
1 parent 48322d1 commit a860975

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/store/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const actions = {
109109
[types.updateComponentPosition]: ({ commit }, payload) => {
110110
commit(types.UPDATE_COMPONENT_POSITION, payload);
111111
},
112-
[types.ADD_BINDING]: ({ commit }, payload) => {
113-
commit(types.ADD_BINDING, payload);
112+
[types.addBindingText]: ({ commit }, payload) => {
113+
commit(types.addBindingText, payload);
114114
},
115115

116116
[types.updateComponentSize]: ({ commit }, payload) => {

src/store/mutations.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ const mutations = {
207207
};
208208
},
209209
// //add binding
210-
[types.ADD_BINDING]: (state, payload) => {
210+
[types.addBindingText]: (state, payload) => {
211211
//access the htmlList, add payload to the empty bind obj
212212
//state.component
213-
console.log(state.componentMap[state.activeComponenet])
213+
console.log(state.componentMap[state.activeComponent])
214214
},
215215
[types.DELETE_ACTION_FROM_COMPONENT]: (state, payload) => {
216216
state.componentMap[state.activeComponent].actions = state.componentMap[state.activeComponent].actions.filter(
@@ -393,7 +393,8 @@ const mutations = {
393393
text: payload.elementName,
394394
id: payload.date,
395395
children: [],
396-
class: ''
396+
class: '',
397+
binding: ""
397398
});
398399
},
399400

@@ -492,25 +493,25 @@ const mutations = {
492493
const idDrag = state.componentMap[componentName].idDrag;
493494
const idDrop = state.componentMap[componentName].idDrop;
494495

495-
if(idDrag !== idDrop && idDrag !== '' && idDrop !== '') {
496+
if (idDrag !== idDrop && idDrag !== '' && idDrop !== '') {
496497
let indexDrag;
497498
let indexDrop;
498499
const htmlList = state.componentMap[componentName].htmlList.slice(0)
499500

500501
if (state.activeLayer.id === "") {
501502
htmlList.forEach((el, i) => {
502-
if(el.id === idDrag){
503+
if (el.id === idDrag) {
503504
indexDrag = i;
504-
} else if (el.id === idDrop){
505+
} else if (el.id === idDrop) {
505506
indexDrop = i;
506507
}
507508
})
508509
const draggedEl = htmlList.splice(indexDrag, 1)[0]
509-
htmlList.splice(indexDrop,0,draggedEl)
510+
htmlList.splice(indexDrop, 0, draggedEl)
510511
} else {
511512
const nestedDrag = breadthFirstSearchParent(htmlList, idDrag);
512513
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]
514515
nestedDrop.evaluated.children.splice(nestedDrop.index, 0, nestedEl)
515516
}
516517
state.componentMap[componentName].htmlList = htmlList;
@@ -523,22 +524,22 @@ const mutations = {
523524
const selectedIdDrag = state.selectedIdDrag;
524525
const selectedIdDrop = state.selectedIdDrop;
525526

526-
if(selectedIdDrag !== selectedIdDrop && selectedIdDrag !== '' && selectedIdDrop !== ''){
527+
if (selectedIdDrag !== selectedIdDrop && selectedIdDrag !== '' && selectedIdDrop !== '') {
527528
const htmlList = state.selectedElementList.slice(0)
528529

529530
let indexDrag;
530531
let indexDrop;
531532

532533
htmlList.forEach((el, i) => {
533-
if(el.id === selectedIdDrag){
534+
if (el.id === selectedIdDrag) {
534535
indexDrag = i;
535-
} else if (el.id === selectedIdDrop){
536+
} else if (el.id === selectedIdDrop) {
536537
indexDrop = i;
537538
}
538539
})
539540

540541
const draggedEl = htmlList.splice(indexDrag, 1)[0]
541-
htmlList.splice(indexDrop,0,draggedEl)
542+
htmlList.splice(indexDrop, 0, draggedEl)
542543
state.selectedElementList = htmlList;
543544
}
544545
state.selectedIdDrag = '';
@@ -720,7 +721,7 @@ const mutations = {
720721

721722
updatedComponent.color = payload.color
722723
},
723-
//Attribute updater for parent
724+
//Attribute updater for parent
724725
[types.EDIT_ATTRIBUTE]: (state, payload) => {
725726
const updatedComponent = state.routes[state.activeRoute].filter(
726727
(element) => element.componentName === payload.activeComponent

src/store/types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const REMOVE_ALL_STATE_PROPS_ACTIONS = 'REMOVE_ALL_STATE_PROPS_ACTIONS'
7979
export const UPDATE_PASTE_TIMER = 'UPDATE_PASTE_TIMER'
8080

8181
export const SET_ID_DRAG = 'SET_ID_DRAG'
82-
export const SET_ID_DROP = 'SET_ID_DROP'
82+
export const SET_ID_DROP = 'SET_ID_DROP'
8383
export const SET_SELECTED_ID_DRAG = 'SET_SELECTED_ID_DRAG'
8484
export const SET_SELECTED_ID_DROP = 'SET_SELECTED_ID_DROP'
8585
export const DRAG_DROP_SORT_HTML_ELEMENTS = 'DRAG_DROP_SORT_HTML_ELEMENTS'
@@ -94,7 +94,7 @@ export const addActiveComponentClass = 'addActiveComponentClass'
9494
export const deleteActiveComponentClass = 'deleteActiveComponentClass'
9595

9696
//adding vmodel info
97-
export const ADD_BINDING = 'ADD_BINDING'
97+
export const addBindingText = 'addBindingText'
9898
//
9999
export const deleteActiveComponentNote = 'deleteActiveComponentNote'
100100
export const addActiveComponentNote = 'addActiveComponentNote'

0 commit comments

Comments
 (0)