Skip to content

Commit

Permalink
Add option to set css classes for hyper schema links.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorn committed Jun 21, 2016
1 parent c455b3c commit cbd6f99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ Simple text link
"links": [
{
"rel": "comments",
"href": "/posts/{{self}}/comments/"
"href": "/posts/{{self}}/comments/",
// Optional - set CSS classes for the link
"class": "comment-link open-in-modal primary-text"
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ JSONEditor.AbstractEditor = Class.extend({
});
}
}

if(data.class) link.className = link.className + ' ' + data.class;

return holder;
},
Expand Down

0 comments on commit cbd6f99

Please sign in to comment.