Mercurial > hg > webaudioevaluationtool
changeset 2414:de547cf9a4e7
WIP for #79
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 27 May 2016 11:02:00 +0100 |
parents | d44b5e04acbc |
children | 36934565bf6e |
files | test_create/test_core.js |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/test_create/test_core.js Fri May 27 10:39:35 2016 +0100 +++ b/test_create/test_core.js Fri May 27 11:02:00 2016 +0100 @@ -1943,6 +1943,21 @@ this.deleteNode.root.textContent = "Delete Entry"; this.deleteNode.root.addEventListener("click",this.deleteNode,false); this.buttonDOM.appendChild(this.deleteNode.root); + + this.getSurveyPosition = function() { + return this.parent.specification.options.findIndex(function(element){ + if (element == this) {return true;} + else {return false;} + },this.specification); + } + + this.swapOrder = function(other) { + // Enables two nodes to swap their respective positions + var other_pos = other.getSurveyPosition(); + var my_pos = this.getSurveyPosition(); + this.parent.specification.options[other_pos] = this.specification; + this.parent.specification.options[my_pos] = other.specification; + } } this.addNode = { root: document.createElement("button"),