Skip to content

Commit af44315

Browse files
committed
delete from nested works..better
1 parent bd38fa0 commit af44315

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/store/mutations.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,20 @@ const mutations = {
221221
const componentName = state.activeComponent
222222
const htmlList = state.componentMap[componentName].htmlList.slice(0)
223223
// splice out selected element and return resulting array
224+
if(state.activeLayer.id === '')
225+
{
226+
for(let i = 0; i<htmlList.length; i++){
227+
if(htmlList[i].id === id){
228+
htmlList.splice(i,1)
229+
break
230+
}
231+
}
232+
} else{
224233
let element = breadthFirstSearchParent(htmlList, id);
225234
console.log("This is element", element)
226235
element.evaluated.children.splice(element.index,1);
227236
// htmlList.splice(idx, 1)
237+
}
228238

229239
state.componentMap[componentName].htmlList = htmlList
230240
},

0 commit comments

Comments
 (0)