Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Add help block elements for labels. #68

Merged
merged 1 commit into from
Jan 28, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions static/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,30 +237,27 @@ $(function(){


function cleanUpJsonEdit() {
// hide spinner
$('#app_settings_schema .spinner').hide();

// make html more boostrap compatible
$('#app_settings_schema .je-field').addClass('control-group');

// move title/field description to div for better UX
$('#app_settings_schema .je-field').each(function(idx, el) {
var $input = $(el).children('input'),
text;
// top level .je-field element has no input child
if ($input.length === 0) {
return;
}
text = $input.attr('title');
// no description property on json schema, skip
if (!text) {
return;
}
$input.parent().append(
'<div class="help-block">' + text + '</div>'
);
$input.removeAttr('title');
// hide spinner
$('#app_settings_schema .spinner').hide();

// make html more boostrap compatible
$('#app_settings_schema .je-field').addClass('control-group');

// move title/field description to div for better UX
$('#app_settings_schema .je-field').each(function(idx, el) {
$(el).children('input, select, textarea, label').each(function(i, input) {
var $input = $(input),
text = $input.attr('title');
// no description property on json schema, skip
if (!text) {
return;
}
$input.after(
'<div class="help-block">' + text + '</div>'
);
$input.removeAttr('title');
});
});
}


Expand Down