# HG changeset patch # User Nicholas Jillings # Date 1455106465 0 # Node ID 4658074c619123aa570739929e4d5b77b5450683 # Parent 9a8ede168abaf48ba42452d751d2a6eca7967233 Popup/Survey buttons now fixed position rather than calculated. diff -r 9a8ede168aba -r 4658074c6191 core.css --- a/core.css Wed Feb 10 12:02:25 2016 +0000 +++ b/core.css Wed Feb 10 12:14:25 2016 +0000 @@ -50,7 +50,7 @@ */ width: 50px; height: 25px; - position: relative; + position: absolute; border-radius: 5px; border: #444; border-width: 1px; @@ -58,6 +58,16 @@ background-color: #fff; } +button#popup-proceed { + bottom: 10px; + right: 10px; +} + +button#popup-previous { + bottom: 10px; + left: 10px; +} + div.testHalt { /* Specify any colouring during the test halt for pre/post questions */ background-color: rgba(0,0,0,0.5); diff -r 9a8ede168aba -r 4658074c6191 core.js --- a/core.js Wed Feb 10 12:02:25 2016 +0000 +++ b/core.js Wed Feb 10 12:14:25 2016 +0000 @@ -480,21 +480,19 @@ this.popupContent.appendChild(this.popupResponse); this.buttonProceed = document.createElement('button'); + this.buttonProceed.id = "popup-proceed"; this.buttonProceed.className = 'popupButton'; - this.buttonProceed.position = 'relative'; - this.buttonProceed.style.left = '390px'; this.buttonProceed.innerHTML = 'Next'; this.buttonProceed.onclick = function(){popup.proceedClicked();}; this.buttonPrevious = document.createElement('button'); + this.buttonPrevious.id = "popup-previous"; this.buttonPrevious.className = 'popupButton'; - this.buttonPrevious.position = 'relative'; - this.buttonPrevious.style.left = '10px'; this.buttonPrevious.innerHTML = 'Back'; this.buttonPrevious.onclick = function(){popup.previousClick();}; - this.popupContent.appendChild(this.buttonPrevious); - this.popupContent.appendChild(this.buttonProceed); + this.popup.appendChild(this.buttonPrevious); + this.popup.appendChild(this.buttonProceed); this.popup.style.zIndex = -1; this.popup.style.visibility = 'hidden'; @@ -613,12 +611,6 @@ } this.popupResponse.appendChild(input); } - var content_height = Number(this.popup.offsetHeight.toFixed()); - content_height -= Number(this.popupContent.offsetHeight.toFixed()); - content_height -=Number(this.buttonProceed.offsetHeight.toFixed()); - content_height = content_height + "px"; - this.buttonProceed.style.top = content_height; - this.buttonPrevious.style.top = content_height; if(this.currentIndex+1 == this.popupOptions.length) { if (this.node.location == "pre") { this.buttonProceed.textContent = 'Start';