changeset 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 756d12f5c330
children b982e92a8dad
files test_create/test_core.js
diffstat 1 files changed, 16 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/test_create/test_core.js	Mon Nov 14 16:21:42 2016 +0000
+++ b/test_create/test_core.js	Mon Nov 14 20:02:08 2016 +0000
@@ -992,6 +992,22 @@
             optionHolder.className = 'node';
             optionHolder.id = 'popup-option-holder';
             this.content.appendChild(optionHolder);
+            this.addMarker = {
+                root: document.createElement("button"),
+                parent: this,
+                handleEvent: function () {
+                    var marker = {
+                        position: 0,
+                        text: "text"
+                    };
+                    this.parent.scaleRoot.scales.push(marker);
+                    var markerNode = new this.parent.buildMarkerNode(this.parent, marker);
+                    document.getElementById("popup-option-holder").appendChild(markerNode.root);
+                    this.parent.markerNodes.push(markerNode);
+                }
+            };
+            this.addMarker.root.textContent = "Add Marker";
+            this.addMarker.root.addEventListener("click", this.addMarker);
             this.generate = function (scaleRoot, parent) {
                 this.scaleRoot = scaleRoot;
                 this.parent = parent;
@@ -1007,23 +1023,6 @@
                     selectOption.textContent = scaleName;
                     this.preset.input.appendChild(selectOption);
                 }
-
-                this.addMarker = {
-                    root: document.createElement("button"),
-                    parent: this,
-                    handleEvent: function () {
-                        var marker = {
-                            position: 0,
-                            text: "text"
-                        };
-                        this.parent.scaleRoot.scales.push(marker);
-                        var markerNode = new this.parent.buildMarkerNode(this.parent, marker);
-                        document.getElementById("popup-option-holder").appendChild(markerNode.root);
-                        this.parent.markerNodes.push(markerNode);
-                    }
-                };
-                this.addMarker.root.textContent = "Add Marker";
-                this.addMarker.root.addEventListener("click", this.addMarker);
                 this.content.appendChild(this.addMarker.root);
 
                 // Create Marker List