changeset 445:63c4163fc705 1.1.0

Version 1.1.0
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Wed, 23 Dec 2015 14:48:21 +0000
parents 9c9fd68693b1
children bb650ec76d81
files core.js
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Wed Dec 23 14:36:00 2015 +0000
+++ b/core.js	Wed Dec 23 14:48:21 2015 +0000
@@ -399,7 +399,7 @@
 			for (var i=0; i<node.options.length; i++) {
 				var option = node.options[i];
 				var input = document.createElement('input');
-				input.id = option.id;
+				input.id = option.name;
 				input.type = 'checkbox';
 				var span = document.createElement('span');
 				span.textContent = option.text;
@@ -1779,8 +1779,13 @@
 								this.statement = element.textContent;
 							} else if (element.nodeName == 'option') {
 								var node = new this.childOption();
-								node.id = element.id;
-								node.name = element.getAttribute('name');
+								if (element.getAttribute('id') != null)
+								{
+									console.log('Checkbox Option id is deprecated, use name instead');
+									node.name = element.getAttribute('id');
+								} else {
+									node.name = element.getAttribute('name');
+								}
 								node.text = element.textContent;
 								this.options.push(node);
 							}
@@ -1827,7 +1832,7 @@
 					{
 						var option = this.options[i];
 						var optionNode = root.createElement("option");
-						optionNode.id = option.id;
+						optionNode.setAttribute("name",option.name);
 						optionNode.textContent = option.text;
 						node.appendChild(optionNode);
 					}