diff --git a/static/js/settings.js b/static/js/settings.js index c262e1f..2c229ea 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -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( - '
' + text + '
' - ); - $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( + '
' + text + '
' + ); + $input.removeAttr('title'); }); + }); }