Style new code like old

This commit is contained in:
David Rowe 2016-06-03 10:40:32 +12:00
parent 21ba4f3394
commit fd77f8401c

View file

@ -973,27 +973,13 @@ function makeTable(setting, keypath, setting_value, isLocked) {
}
if (isArray && col.type === "checkbox" && col.editable) {
html += "<td class='" + Settings.DATA_COL_CLASS + "'name='" + col.name + "'>"
html += "<input type='checkbox' "
html += "class='form-control toggle-checkbox table-checkbox' "
html += "name='" + colName + "'"
html += (colValue ? " checked" : "")
html += " />"
html += "</td>"
+ "<input type='checkbox' class='form-control toggle-checkbox table-checkbox' "
+ "name='" + colName + "'" + (colValue ? " checked" : "") + " /></td>";
} else {
// setup the td for this column
html += "<td class='" + Settings.DATA_COL_CLASS + "' name='" + colName + "'>";
// add the actual value to the td so it is displayed
html += colValue;
// for values to be posted properly we add a hidden input to this td
html += "<input type='hidden' name='" + colName + "' value='" + colValue + "'/>";
html += "</td>";
// Use a hidden input so that the values are posted.
html += "<td class='" + Settings.DATA_COL_CLASS + "' name='" + colName + "'>"
+ colValue + "<input type='hidden' name='" + colName + "' value='" + colValue + "'/></td>";
}
})
@ -1039,12 +1025,8 @@ function makeTableInputs(setting) {
_.each(setting.columns, function(col) {
if (col.type === "checkbox") {
html += "<td class='" + Settings.DATA_COL_CLASS + "'name='" + col.name + "'>"
html += "<input type='checkbox' "
html += "class='form-control toggle-checkbox' "
html += "name='" + col.name + "'"
html += (col.default ? " checked" : "")
html += "/>"
html += "</td>"
+ "<input type='checkbox' class='form-control toggle-checkbox' name='" + col.name + "'"
+ (col.default ? " checked" : "") + "/></td>";
} else {
html += "<td class='" + Settings.DATA_COL_CLASS + "'name='" + col.name + "'>\
<input type='text' class='form-control' placeholder='" + (col.placeholder ? col.placeholder : "") + "'\