Mercurial > hg > webaudioevaluationtool
changeset 2243:0de305726129
Fixed test create not exposing interface node title element.
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Mon, 18 Apr 2016 13:47:35 +0100 |
parents | 86fd1dbae138 |
children | 1e1b689e2a60 |
files | js/specification.js test_create/test_core.js |
diffstat | 2 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/js/specification.js Fri Apr 15 16:11:47 2016 +0100 +++ b/js/specification.js Mon Apr 18 13:47:35 2016 +0100 @@ -370,6 +370,11 @@ var node = doc.createElement("interface"); if (typeof name == "string") node.setAttribute("name",this.name); + if (typeof this.title == "string") { + var titleNode = doc.createElement("title"); + titleNode.textContent = this.title; + node.appendChild(titleNode); + } for (var option of this.options) { var child = doc.createElement("interfaceoption");
--- a/test_create/test_core.js Fri Apr 15 16:11:47 2016 +0100 +++ b/test_create/test_core.js Mon Apr 18 13:47:35 2016 +0100 @@ -1585,6 +1585,27 @@ this.buttonDOM = obj.buttonsDOM; this.HTMLPoint = parent; this.rootDOM.removeChild(this.attributeDOM); + if (parent.id != "setup") { + // Put in the <title> node: + this.titleNode = { + root: document.createElement("div"), + label: document.createElement("span"), + input: document.createElement("input"), + parent: this, + handleEvent: function(event) { + this.parent.specification.title = event.currentTarget.value; + } + } + this.titleNode.label.textContent = "Axis Title:"; + this.titleNode.root.className = "node-children"; + this.titleNode.root.appendChild(this.titleNode.label); + this.titleNode.root.appendChild(this.titleNode.input); + this.titleNode.input.addEventListener("change",this.titleNode,false); + this.titleNode.input.value = this.specification.title; + this.children.push(this.titleNode); + this.childrenDOM.appendChild(this.titleNode.root); + } + // Put in the check / show options as individual children var checks = this.parent.createGeneralNodeDOM("Checks","setup-interface-checks",this);