add a tooltip to say why locked settings cannot be changed

This commit is contained in:
Stephen Birarda 2014-09-29 10:02:01 -07:00
parent 58b03c7ef2
commit 46258ae78f
2 changed files with 17 additions and 3 deletions

View file

@ -52,6 +52,10 @@ span.port {
color: red;
}
.locked {
color: blue;
}
.advanced-setting {
display: none;
}

View file

@ -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'
})
});
}