Fixes Custom Fields (Turtle) Demo Browser Support (#2697)

* Fixed firefox not displaying correctly.

* Fixed IE support.
This commit is contained in:
Beka Westberg
2019-07-24 09:40:08 -07:00
committed by RoboErikG
parent 57e9fc35c7
commit cb86dba3af
2 changed files with 12 additions and 5 deletions

View File

@@ -455,11 +455,18 @@ CustomFields.FieldTurtle.prototype.updateColour = function() {
var child = this.turtleGroup_.firstChild;
while(child) {
// If it is a text node, or a non-turtle node.
if (child.nodeType == 3 || !child.classList.contains('turtleBody')) {
// If it is a text node, continue.
if (child.nodeType == 3) {
child = child.nextSibling;
continue;
}
// Or if it is a non-turtle node, continue.
var className = child.getAttribute('class');
if (!className || className.indexOf('turtleBody') == -1) {
child = child.nextSibling;
continue;
}
child.style.fill = fillColour;
child.style.stroke = borderColour;
child = child.nextSibling;

View File

@@ -40,16 +40,16 @@
<input type="button" value="Import from XML" onclick="fromXml()">
</p>
<table style="width: 800px; height: 480px">
<table>
<tr>
<td>
<textarea id="importExport"
style="width: 200px; height: 100%;"
style="width: 200px; height: 480px;"
onchange="textAreaChange();"
onkeyup="textAreaChange()"></textarea>
</td>
<td>
<div id="blocklyDiv" style="width: 600px; height: 100%;"></div>
<div id="blocklyDiv" style="width: 600px; height: 480px;"></div>
</td>
</tr>
</table>