jquery-jsonview
jquery-jsonview copied to clipboard
Add callback and marks options
These 2 commits to make the plugin more configurable by adding 3 new options:
jQuery('#json').JSONView(json, {
marks:{
'+':'++',
'-':'--',
},
on_expand: function(collapser){
console.log(['on_expand', collapser]);
},
on_collapse: function(collapser){
console.log(['on_collapse', collapser]);
}
});
Thanks for the PR.
This plugin is written in CoffeScript, you should edit files under src/ instead of dist/jquery.jsonview.js.
As I'm not familiar with CoffeScript it will take some time to investigate how convert my changes into that. So probably later I'll try to PR again. Or you can incorporate my changes at your own.
+1