Mercurial > hg > webaudioevaluationtool
changeset 2315:a7e50a52a896
Fix for #31. Add Page is now at the bottom, new pages inserted above.
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Fri, 29 Apr 2016 15:36:29 +0100 |
parents | 70bb8e542741 |
children | 0ca5bcfdc2d4 |
files | test_create/style.css test_create/test_core.js |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/test_create/style.css Fri Apr 29 15:20:25 2016 +0100 +++ b/test_create/style.css Fri Apr 29 15:36:29 2016 +0100 @@ -78,7 +78,7 @@ } -div#content > div.node{ +div#page-holder > div.node{ background-color: rgb(200,228,151); }
--- a/test_create/test_core.js Fri Apr 29 15:20:25 2016 +0100 +++ b/test_create/test_core.js Fri Apr 29 15:36:29 2016 +0100 @@ -1451,21 +1451,28 @@ var pageObj = new specification.page(specification); specification.pages.push(pageObj); var newPage = new this.parent.pageNode(this.parent,pageObj); - this.parent.injectDOM.appendChild(newPage.rootDOM); + document.getElementById("page-holder").appendChild(newPage.rootDOM); this.parent.pages.push(newPage); } } this.addPage.root.textContent = "Add Page"; + this.addPage.root.id = "new-page-button"; + this.addPage.root.style.float = "left"; this.addPage.root.addEventListener("click",this.addPage,false); - this.injectDOM.appendChild(this.addPage.root); + + var pageHolder = document.createElement("div"); + pageHolder.id ="page-holder"; + this.injectDOM.appendChild(pageHolder); // Build each page for (var page of specification.pages) { var newPage = new this.pageNode(this,page); - this.injectDOM.appendChild(newPage.rootDOM); + pageHolder.appendChild(newPage.rootDOM); this.pages.push(newPage); } + + this.injectDOM.appendChild(this.addPage.root); } this.interfaceNode = function(parent,rootObject)