changeset 1911:db2a2a4a773e

Fix Bug #1562
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Tue, 22 Mar 2016 12:35:48 +0000
parents 46fe764580fb
children c0ff84783b59
files core.css core.js
diffstat 2 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/core.css	Tue Mar 22 12:09:08 2016 +0000
+++ b/core.css	Tue Mar 22 12:35:48 2016 +0000
@@ -79,6 +79,19 @@
 	background-color: #fff;
 }
 
+div.popup-option-checbox {
+    /* Popup window checkbox */
+    padding: 5px;
+    width: fit-content;
+    width: -moz-fit-content;
+    width: -webkit-fit-content;
+}
+
+div.popup-option-checbox input{
+    /* Popup window checkbox */
+    margin-right: 15px;
+}
+
 button#popup-proceed {
     bottom: 10px;
     right: 10px;
--- a/core.js	Tue Mar 22 12:09:08 2016 +0000
+++ b/core.js	Tue Mar 22 12:35:48 2016 +0000
@@ -601,7 +601,7 @@
 				span.textContent = option.text;
 				var hold = document.createElement('div');
 				hold.setAttribute('name','option');
-				hold.style.padding = '4px';
+                hold.className = "popup-option-checbox";
 				hold.appendChild(input);
 				hold.appendChild(span);
 				this.popupResponse.appendChild(hold);
@@ -610,14 +610,13 @@
                         input.checked = "true";
                     }
                 }
-                var w = $(span).width();
+                var w = $(hold).width();
                 if (w > max_w)
                     max_w = w;
                 index++;
 			}
-            max_w += 12;
             this.popupResponse.style.textAlign="";
-            var leftP = ((max_w/500)/2)*100;
+            var leftP = 50-(((max_w/$('#popupContent').width())/2)*100);
             this.popupResponse.style.left=leftP+"%";
 		} else if (node.specification.type == 'radio') {
             if (node.response == undefined) {
@@ -634,20 +633,19 @@
 				span.textContent = option.text;
 				var hold = document.createElement('div');
 				hold.setAttribute('name','option');
-				hold.style.padding = '4px';
+				hold.className = "popup-option-checbox";
 				hold.appendChild(input);
 				hold.appendChild(span);
 				this.popupResponse.appendChild(hold);
                 if (input.id == node.response.name) {
                     input.checked = "true";
                 }
-                var w = $(span).width();
+                var w = $(hold).width();
                 if (w > max_w)
                     max_w = w;
 			}
-            max_w += 12;
             this.popupResponse.style.textAlign="";
-            var leftP = ((max_w/500)/2)*100;
+            var leftP = 50-(((max_w/$('#popupContent').width())/2)*100);
             this.popupResponse.style.left=leftP+"%";
 		} else if (node.specification.type == 'number') {
 			var input = document.createElement('input');