Pass view_name to extra_body_script hook (#443)

At the moment it's not easy to tell whether the hook is being called
in (for example) the row or table view, as in both cases the
`database` and `table` parameters are provided.

This passes the `view_name` added in #441 to the `extra_body_script`
hook.
This commit is contained in:
Russ Garrett 2019-05-03 14:12:19 +01:00 committed by Simon Willison
commit bf229c9bd8
3 changed files with 7 additions and 3 deletions

View file

@ -26,7 +26,7 @@ def extra_js_urls(template, database, table, datasette):
@hookspec
def extra_body_script(template, database, table, datasette):
def extra_body_script(template, database, table, view_name, datasette):
"Extra JavaScript code to be included in <script> at bottom of body"