mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 17:30:37 +02:00
add a tooltip to say why locked settings cannot be changed
This commit is contained in:
parent
58b03c7ef2
commit
46258ae78f
2 changed files with 17 additions and 3 deletions
|
@ -52,6 +52,10 @@ span.port {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.locked {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
.advanced-setting {
|
.advanced-setting {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,13 @@ var viewHelpers = {
|
||||||
setting_value = ""
|
setting_value = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label_class = 'control-label'
|
||||||
|
if (isLocked) {
|
||||||
|
label_class += ' locked'
|
||||||
|
}
|
||||||
|
|
||||||
if (setting.type === 'checkbox') {
|
if (setting.type === 'checkbox') {
|
||||||
form_group += "<label class='control-label'>" + setting.label + "</label>"
|
form_group += "<label class='" + label_class + "'>" + setting.label + "</label>"
|
||||||
form_group += "<div class='checkbox" + (isLocked ? " disabled" : "") + "'>"
|
form_group += "<div class='checkbox" + (isLocked ? " disabled" : "") + "'>"
|
||||||
form_group += "<label for='" + setting_id + "'>"
|
form_group += "<label for='" + setting_id + "'>"
|
||||||
form_group += "<input type='checkbox' id='" + setting_id + "' " +
|
form_group += "<input type='checkbox' id='" + setting_id + "' " +
|
||||||
|
@ -29,7 +34,7 @@ var viewHelpers = {
|
||||||
} else {
|
} else {
|
||||||
input_type = _.has(setting, 'type') ? setting.type : "text"
|
input_type = _.has(setting, 'type') ? setting.type : "text"
|
||||||
|
|
||||||
form_group += "<label for='" + setting_id + "' class='control-label'>" + setting.label + "</label>";
|
form_group += "<label for='" + setting_id + "' class='" + label_class + "'>" + setting.label + "</label>";
|
||||||
form_group += "<input type='" + input_type + "' class='form-control' id='" + setting_id +
|
form_group += "<input type='" + input_type + "' class='form-control' id='" + setting_id +
|
||||||
"' placeholder='" + (_.has(setting, 'placeholder') ? setting.placeholder : "") +
|
"' placeholder='" + (_.has(setting, 'placeholder') ? setting.placeholder : "") +
|
||||||
"' value='" + setting_value + "'" + (isLocked ? " disabled" : "") + "/>"
|
"' value='" + setting_value + "'" + (isLocked ? " disabled" : "") + "/>"
|
||||||
|
@ -104,7 +109,12 @@ function reloadSettings() {
|
||||||
$('#panels').html(Settings.panelsTemplate(data))
|
$('#panels').html(Settings.panelsTemplate(data))
|
||||||
|
|
||||||
Settings.initialValues = form2js('settings-form', "_", false, cleanupFormValues, true);
|
Settings.initialValues = form2js('settings-form', "_", false, cleanupFormValues, true);
|
||||||
$('[data-target=tooltip]').tooltip()
|
|
||||||
|
// add tooltip to locked settings
|
||||||
|
$('label.locked').tooltip({
|
||||||
|
placement: 'right',
|
||||||
|
title: 'This setting is in the master config file and cannot be changed'
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue