json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

Added tooltip support in schema properties.

Open dmcallejo opened this issue 9 years ago • 2 comments

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
     }, (...)

dmcallejo avatar Oct 12 '15 14:10 dmcallejo

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 function addTooltip 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)

jdorn avatar Nov 19 '15 15:11 jdorn

has this item been merged in the base branch? I would really like this feature as well.

nipunarora avatar May 26 '16 03:05 nipunarora