mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 21:46:34 +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;
|
||||
}
|
||||
|
||||
.locked {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.advanced-setting {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -18,8 +18,13 @@ var viewHelpers = {
|
|||
setting_value = ""
|
||||
}
|
||||
|
||||
label_class = 'control-label'
|
||||
if (isLocked) {
|
||||
label_class += ' locked'
|
||||
}
|
||||
|
||||
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 += "<label for='" + setting_id + "'>"
|
||||
form_group += "<input type='checkbox' id='" + setting_id + "' " +
|
||||
|
@ -29,7 +34,7 @@ var viewHelpers = {
|
|||
} else {
|
||||
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 +
|
||||
"' placeholder='" + (_.has(setting, 'placeholder') ? setting.placeholder : "") +
|
||||
"' value='" + setting_value + "'" + (isLocked ? " disabled" : "") + "/>"
|
||||
|
@ -104,7 +109,12 @@ function reloadSettings() {
|
|||
$('#panels').html(Settings.panelsTemplate(data))
|
||||
|
||||
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