mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
Merge pull request #4047 from birarda/master
some fixes to domain-server settings
This commit is contained in:
commit
1d7f1de883
1 changed files with 5 additions and 6 deletions
|
@ -364,7 +364,7 @@ function makeTableInputs(setting) {
|
||||||
_.each(setting.columns, function(col) {
|
_.each(setting.columns, function(col) {
|
||||||
html += "<td class='" + Settings.DATA_COL_CLASS + "'name='" + col.name + "'>\
|
html += "<td class='" + Settings.DATA_COL_CLASS + "'name='" + col.name + "'>\
|
||||||
<input type='text' class='form-control' placeholder='" + (col.placeholder ? col.placeholder : "") + "'\
|
<input type='text' class='form-control' placeholder='" + (col.placeholder ? col.placeholder : "") + "'\
|
||||||
value='" + (col.default ? col.default : "") + "'>\
|
value='" + (col.default ? col.default : "") + "' data-default='" + (col.default ? col.default : "") + "'>\
|
||||||
</td>"
|
</td>"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ function addTableRow(add_glyphicon) {
|
||||||
})
|
})
|
||||||
|
|
||||||
input_clone.find('input').each(function(){
|
input_clone.find('input').each(function(){
|
||||||
$(this).val('')
|
$(this).val($(this).attr('data-default'));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isArray) {
|
if (isArray) {
|
||||||
|
@ -525,9 +525,9 @@ function deleteTableRow(delete_glyphicon) {
|
||||||
var table = $(row).closest('table')
|
var table = $(row).closest('table')
|
||||||
var isArray = table.data('setting-type') === 'array'
|
var isArray = table.data('setting-type') === 'array'
|
||||||
|
|
||||||
|
row.empty();
|
||||||
|
|
||||||
if (!isArray) {
|
if (!isArray) {
|
||||||
// this is a hash row, so we empty it but leave the hidden input blank so it is cleared when we save
|
|
||||||
row.empty()
|
|
||||||
row.html("<input type='hidden' class='form-control' name='"
|
row.html("<input type='hidden' class='form-control' name='"
|
||||||
+ row.attr('name') + "' data-changed='true' value=''>");
|
+ row.attr('name') + "' data-changed='true' value=''>");
|
||||||
} else {
|
} else {
|
||||||
|
@ -538,7 +538,6 @@ function deleteTableRow(delete_glyphicon) {
|
||||||
row.remove()
|
row.remove()
|
||||||
} else {
|
} else {
|
||||||
// this is the last row, we can't remove it completely since we need to post an empty array
|
// this is the last row, we can't remove it completely since we need to post an empty array
|
||||||
row.empty()
|
|
||||||
|
|
||||||
row.removeClass(Settings.DATA_ROW_CLASS).removeClass(Settings.NEW_ROW_CLASS)
|
row.removeClass(Settings.DATA_ROW_CLASS).removeClass(Settings.NEW_ROW_CLASS)
|
||||||
row.addClass('empty-array-row')
|
row.addClass('empty-array-row')
|
||||||
|
@ -592,7 +591,7 @@ function updateDataChangedForSiblingRows(row, forceTrue) {
|
||||||
var initialPanelSettingJSON = Settings.initialValues[panelParentID][tableShortName]
|
var initialPanelSettingJSON = Settings.initialValues[panelParentID][tableShortName]
|
||||||
|
|
||||||
// if they are equal, we don't need data-changed
|
// if they are equal, we don't need data-changed
|
||||||
isTrue = _.isEqual(panelSettingJSON, initialPanelSettingJSON)
|
isTrue = !_.isEqual(panelSettingJSON, initialPanelSettingJSON)
|
||||||
} else {
|
} else {
|
||||||
isTrue = true
|
isTrue = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue