Mercurial > hg > webaudioevaluationtool
comparison test_create/test_core.js @ 2609:5409400fc1fb
Fix for #73
| author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
|---|---|
| date | Mon, 14 Nov 2016 20:02:08 +0000 |
| parents | fddfb7c0b4fa |
| children | b982e92a8dad |
comparison
equal
deleted
inserted
replaced
| 2608:756d12f5c330 | 2609:5409400fc1fb |
|---|---|
| 990 this.content.appendChild(this.preset.input); | 990 this.content.appendChild(this.preset.input); |
| 991 var optionHolder = document.createElement("div"); | 991 var optionHolder = document.createElement("div"); |
| 992 optionHolder.className = 'node'; | 992 optionHolder.className = 'node'; |
| 993 optionHolder.id = 'popup-option-holder'; | 993 optionHolder.id = 'popup-option-holder'; |
| 994 this.content.appendChild(optionHolder); | 994 this.content.appendChild(optionHolder); |
| 995 this.addMarker = { | |
| 996 root: document.createElement("button"), | |
| 997 parent: this, | |
| 998 handleEvent: function () { | |
| 999 var marker = { | |
| 1000 position: 0, | |
| 1001 text: "text" | |
| 1002 }; | |
| 1003 this.parent.scaleRoot.scales.push(marker); | |
| 1004 var markerNode = new this.parent.buildMarkerNode(this.parent, marker); | |
| 1005 document.getElementById("popup-option-holder").appendChild(markerNode.root); | |
| 1006 this.parent.markerNodes.push(markerNode); | |
| 1007 } | |
| 1008 }; | |
| 1009 this.addMarker.root.textContent = "Add Marker"; | |
| 1010 this.addMarker.root.addEventListener("click", this.addMarker); | |
| 995 this.generate = function (scaleRoot, parent) { | 1011 this.generate = function (scaleRoot, parent) { |
| 996 this.scaleRoot = scaleRoot; | 1012 this.scaleRoot = scaleRoot; |
| 997 this.parent = parent; | 1013 this.parent = parent; |
| 998 | 1014 |
| 999 // Generate Pre-Set dropdown | 1015 // Generate Pre-Set dropdown |
| 1005 var scaleName = protoScales[i].getAttribute("name"); | 1021 var scaleName = protoScales[i].getAttribute("name"); |
| 1006 selectOption.setAttribute("name", scaleName); | 1022 selectOption.setAttribute("name", scaleName); |
| 1007 selectOption.textContent = scaleName; | 1023 selectOption.textContent = scaleName; |
| 1008 this.preset.input.appendChild(selectOption); | 1024 this.preset.input.appendChild(selectOption); |
| 1009 } | 1025 } |
| 1010 | |
| 1011 this.addMarker = { | |
| 1012 root: document.createElement("button"), | |
| 1013 parent: this, | |
| 1014 handleEvent: function () { | |
| 1015 var marker = { | |
| 1016 position: 0, | |
| 1017 text: "text" | |
| 1018 }; | |
| 1019 this.parent.scaleRoot.scales.push(marker); | |
| 1020 var markerNode = new this.parent.buildMarkerNode(this.parent, marker); | |
| 1021 document.getElementById("popup-option-holder").appendChild(markerNode.root); | |
| 1022 this.parent.markerNodes.push(markerNode); | |
| 1023 } | |
| 1024 }; | |
| 1025 this.addMarker.root.textContent = "Add Marker"; | |
| 1026 this.addMarker.root.addEventListener("click", this.addMarker); | |
| 1027 this.content.appendChild(this.addMarker.root); | 1026 this.content.appendChild(this.addMarker.root); |
| 1028 | 1027 |
| 1029 // Create Marker List | 1028 // Create Marker List |
| 1030 this.buildMarkerList(); | 1029 this.buildMarkerList(); |
| 1031 } | 1030 } |
