Added <tr> elements back into row templates.

I had hoped removing them would be a workaround for my Vulcanize, but
that's not the case, and having them simplifies the JS slightly.
This commit is contained in:
Oliver Hamlet
2014-11-11 18:12:26 +00:00
parent cae6d83f8f
commit cfc5265d6a
+14 -6
View File
@@ -4,12 +4,15 @@
<link rel="import" href="../bower_components/core-icons/core-icons.html">
<template id="fileRow">
<tr>
<td><input class="name" type="text" required></td>
<td><input class="display" type="text"></td>
<td><input class="condition" type="text"></td>
<td><paper-icon-button class="delete" icon="delete"></paper-icon-button></td>
</tr>
</template>
<template id="messageRow">
<tr>
<td><select class="type">
<option value="say">Note</option>
<option value="warn">Warning</option>
@@ -23,8 +26,10 @@
</select>
</td>
<td><paper-icon-button class="delete" icon="delete"></paper-icon-button></td>
</tr>
</template>
<template id="tagRow">
<tr>
<td><select class="type">
<option value="add">Add</option>
<option value="remove">Remove</option>
@@ -33,21 +38,27 @@
<td><input class="name" type="text" required></td>
<td><input class="condition" type="text"></td>
<td><paper-icon-button class="delete" icon="delete"></paper-icon-button></td>
</tr>
</template>
<template id="dirtyInfoRow">
<tr>
<td><input class="crc" type="text" maxlength="8" minlength="8" pattern="[0-9A-Fa-f]{8}" required></td>
<td><input class="itm" type="number" min="0" step="1" value="0"></td>
<td><input class="udr" type="number" min="0" step="1" value="0"></td>
<td><input class="nav" type="number" min="0" step="1" value="0"></td>
<td><input class="util" type="text" required></td>
<td><paper-icon-button class="delete" icon="delete"></paper-icon-button></td>
</tr>
</template>
<template id="locationRow">
<tr>
<td><input class="link" type="text" required></td>
<td><input class="ver" type="text"></td>
<td><paper-icon-button class="delete" icon="delete"></paper-icon-button></td>
</tr>
</template>
<template id="gameRow">
<tr>
<td><input class="name" type="text" required></td>
<td>
<select class="type">
@@ -61,6 +72,7 @@
<td><input class="path" type="text"></td>
<td><input class="registry" type="text"></td>
<td><paper-icon-button class="delete" icon="delete"></paper-icon-button></td>
</tr>
</template>
<style>
table[is=editable-table] td:last-child {
@@ -237,10 +249,8 @@ td paper-icon-button.hidden {
} else {
content = document.getElementById(rowTemplateId).content;
}
var rowContent = document.importNode(content, true);
var row = document.importNode(content, true);
var row = document.createElement('tr');
row.appendChild(rowContent);
table.tBodies[0].insertBefore(row, evt.currentTarget);
row = evt.currentTarget.previousElementSibling;
@@ -258,10 +268,8 @@ td paper-icon-button.hidden {
} else {
content = document.getElementById(rowTemplateId).content;
}
var rowContent = document.importNode(content, true);
var row = document.importNode(content, true);
var row = document.createElement('tr');
row.appendChild(rowContent);
var tbody = this.tBodies[0];
tbody.insertBefore(row, tbody.lastElementChild);
row = tbody.lastElementChild.previousElementSibling;