mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 17:35:45 +02:00
Changed data to row-data
This commit is contained in:
parent
dd90ea01bd
commit
e2d3ca53e6
1 changed files with 7 additions and 7 deletions
|
@ -84,7 +84,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
$('#settings-form').on('click', '.add-row', function(){
|
$('#settings-form').on('click', '.add-row', function(){
|
||||||
var row = $(this).parents("tr")
|
var row = $(this).parents("tr")
|
||||||
var data = row.parent().children(".data")
|
var row-data = row.parent().children(".row-data")
|
||||||
|
|
||||||
// Check key spaces
|
// Check key spaces
|
||||||
var name = row.children(".key").children("input").val()
|
var name = row.children(".key").children("input").val()
|
||||||
|
@ -94,7 +94,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
// Check keys with the same name
|
// Check keys with the same name
|
||||||
var equals = false;
|
var equals = false;
|
||||||
_.each(data.children(".key"), function(element) {
|
_.each(row-data.children(".key"), function(element) {
|
||||||
if ($(element).text() === name) {
|
if ($(element).text() === name) {
|
||||||
equals = true
|
equals = true
|
||||||
return
|
return
|
||||||
|
@ -107,7 +107,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
// Check empty fields
|
// Check empty fields
|
||||||
var empty = false;
|
var empty = false;
|
||||||
_.each(row.children(".data").children("input"), function(element) {
|
_.each(row.children(".row-data").children("input"), function(element) {
|
||||||
if ($(element).val().length === 0) {
|
if ($(element).val().length === 0) {
|
||||||
empty = true
|
empty = true
|
||||||
return
|
return
|
||||||
|
@ -121,11 +121,11 @@ $(document).ready(function(){
|
||||||
var input_clone = row.clone()
|
var input_clone = row.clone()
|
||||||
// Change input row to data row
|
// Change input row to data row
|
||||||
var full_name = row.parents("table").attr("name") + "." + name
|
var full_name = row.parents("table").attr("name") + "." + name
|
||||||
row.attr("class", "data")
|
row.attr("class", "row-data")
|
||||||
|
|
||||||
_.each(row.children(), function(element) {
|
_.each(row.children(), function(element) {
|
||||||
if ($(element).hasClass("number")) { // Index row
|
if ($(element).hasClass("number")) { // Index row
|
||||||
var numbers = data.children(".number")
|
var numbers = row-data.children(".number")
|
||||||
if (numbers.length > 0) {
|
if (numbers.length > 0) {
|
||||||
$(element).html(parseInt(numbers.last().text()) + 1)
|
$(element).html(parseInt(numbers.last().text()) + 1)
|
||||||
} else {
|
} else {
|
||||||
|
@ -147,7 +147,7 @@ $(document).ready(function(){
|
||||||
var input = $(element).children("input")
|
var input = $(element).children("input")
|
||||||
$(element).html(input.val())
|
$(element).html(input.val())
|
||||||
input.remove()
|
input.remove()
|
||||||
} else if($(element).hasClass("data")) { // Hide inputs
|
} else if($(element).hasClass("row-data")) { // Hide inputs
|
||||||
var input = $(element).children("input")
|
var input = $(element).children("input")
|
||||||
input.attr("type", "hidden")
|
input.attr("type", "hidden")
|
||||||
input.attr("name", full_name + "." + $(element).attr("name"))
|
input.attr("name", full_name + "." + $(element).attr("name"))
|
||||||
|
@ -302,7 +302,7 @@ function makeTable(setting, setting_name, setting_value) {
|
||||||
// Rows
|
// Rows
|
||||||
var row_num = 1
|
var row_num = 1
|
||||||
_.each(setting_value, function(row, name) {
|
_.each(setting_value, function(row, name) {
|
||||||
html += "<tr class='data' name='" + setting_name + "." + name + "'>"
|
html += "<tr class='row-data' name='" + setting_name + "." + name + "'>"
|
||||||
if (setting.number === true) {
|
if (setting.number === true) {
|
||||||
html += "<td class='number'>" + row_num + "</td>"
|
html += "<td class='number'>" + row_num + "</td>"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue