jmrivas86 / django-json-widget

An alternative widget that makes it easy to edit the new Django's field JSONField (PostgreSQL specific model fields)
MIT License
433 stars 88 forks source link

support multiple instances of plugin on same page #5

Closed k-nut closed 6 years ago

k-nut commented 6 years ago

this adds a self invoking wrapping function to scope the variables to the local block. Otherwise if the plugin was included multiple times (because there were multiple JSON-Fields in the form) the second script tag’s variables such as container would overwrite the ones from the first tag resulting in the same data being submitted for all models.

Fixes #3

jmrivas86 commented 6 years ago

LGTM. Thank you very much for your contribution 😄