changeset 2565:bc6edd2c8772

Completed #5
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 08 Sep 2016 11:05:23 +0100
parents 26045169b4b5
children 172c76d9414b
files test_create/test_core.js
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test_create/test_core.js	Thu Sep 08 10:54:57 2016 +0100
+++ b/test_create/test_core.js	Thu Sep 08 11:05:23 2016 +0100
@@ -2011,7 +2011,7 @@
                     root: document.createElement("button"),
                     parent: this,
                     handleEvent: function(event) {
-                        this.root.parentElement.removeChild(this.root);
+                        this.parent.parent.childrenDOM.removeChild(this.parent.rootDOM);
                         this.parent.parent.addConditional.root.disabled = false;
                         var index = this.parent.parent.children.findIndex(function(element){
                             if (this == element) {return true;} return false;
@@ -2019,6 +2019,12 @@
                         if (index >= 0) {
                             this.parent.parent.children.splice(index,1);
                         }
+                        index = this.parent.parent.specification.conditions.findIndex(function(element){
+                            if (this == element) {return true;} return false;
+                        },this.parent.specification);
+                        if (index >= 0) {
+                            this.parent.parent.specification.conditions.splice(index);
+                        }
                     }
                 }
                 this.deleteNode.root.textContent = "Delete";