json-editor
json-editor copied to clipboard
Added tooltip support in schema properties.
This allows the addition of more detailed descriptions for each property of the schema. Usage is as simple as adding a "tooltip" field into the property, as stated in the examples:
"properties": {
"name": {
"type": "string",
"description": "First and Last name",
"tooltip": "First and last name of the simple person",
"minLength": 4
}, (...)
I like the idea. A couple comments:
- Move 'tooltip' under options since it isn't a standard JSON Schema keyword
{
"type": "string",
"minLength": 4,
"options": {
"tooltip": "This is a tooltip"
}
}
- Instead of adding another argument to
getFormControl
, I would create a new theme functionaddTooltip
that takes a DOM node as an argument. That way it can be reused elsewhere and it will be easier for themes to override.
this.control = this.theme.getFormControl(this.label, this.input, this.description);
this.theme.addTooltip(this.control, this.tooltip);
- For bootstrap3, add
data-toggle="tooltip"
to the element (http://getbootstrap.com/javascript/#tooltips)
has this item been merged in the base branch? I would really like this feature as well.