Skip to content

Commit

Permalink
(properties docs)Updated docs.json
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed Jan 29, 2020
1 parent 0c38e33 commit 5386839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"id": "mv-edit",
"advanced": false,
"title": "Customize editing: The mv-edit attribute",
"content": "In some cases, you may want to customize how a property is edited. For example, instead of using a text field, you may want to restrict choices to those in a `<select>` menu. For those cases, you can do one of two things:\n\n* Link to a form control via `mv-edit` _(recommended)_\n* Nest a form control directly inside your property\n\nThe value of `mv-edit` is a CSS selector. If the CSS selector matches multiple elements on the page, the first one will be used. The element you linked to remains intact. Instead, it is cloned for the editing. If the original element changes (e.g. perhaps that's also populated by Mavo! It could even be an entirely separate Mavo app, like in [this demo](/demos/talks/)), a new clone is created.\n\nIn addition to using the element for editing, its default value also becomes the property’s default value (unless `mv-default` is set of course).\n\n##### Example\n\n```html\nI’m from\n<img src=\"/demos/talks/flags/[country].png\" />\n<span property=\"country\" mv-edit=\"#countries\"></span>\n\n<div hidden>\n\t<select id=\"countries\">\n\t\t<option value=\"gr\">Greece</option>\n\t\t<option value=\"gb\">United Kingdom</option>\n\t\t<option value=\"us\">United States</option>\n\t</select>\n</div>\n```"
"content": "In some cases, you may want to customize how a property is edited. For example, instead of using a text field, you may want to restrict choices to those in a `<select>` menu. For those cases, you can link to a form control via `mv-edit`.\n\nThe value of `mv-edit` is a CSS selector. If the CSS selector matches multiple elements on the page, the first one will be used. The element you linked to remains intact. Instead, it is cloned for the editing. If the original element changes (e.g. perhaps that's also populated by Mavo! It could even be an entirely separate Mavo app, like in [this demo](/demos/talks/)), a new clone is created.\n\nIn addition to using the element for editing, its default value also becomes the property’s default value (unless `mv-default` is set of course).\n\n##### Example\n\n```html\nI’m from\n<img src=\"/demos/talks/flags/[country].png\" />\n<span property=\"country\" mv-edit=\"#countries\"></span>\n\n<div hidden>\n\t<select id=\"countries\">\n\t\t<option value=\"gr\">Greece</option>\n\t\t<option value=\"gb\">United Kingdom</option>\n\t\t<option value=\"us\">United States</option>\n\t</select>\n</div>\n```"
},
{
"id": "mv-edit-star",
Expand Down

0 comments on commit 5386839

Please sign in to comment.