diff --git a/docs/datasette-modal-example.png b/docs/datasette-modal-example.png new file mode 100644 index 00000000..081592d0 Binary files /dev/null and b/docs/datasette-modal-example.png differ diff --git a/docs/javascript_plugins.rst b/docs/javascript_plugins.rst index f7559120..607c9f59 100644 --- a/docs/javascript_plugins.rst +++ b/docs/javascript_plugins.rst @@ -105,6 +105,12 @@ The simplest way to create a modal from a plugin is ``datasetteManager.createMod // modal.showModal({trigger: button}); }); +Calling ``modal.showModal()`` then displays the dialog: + +.. image:: datasette-modal-example.png + :alt: A modal dialog titled "My plugin" containing the text "Hello from a plugin!" and Cancel and Save buttons, shown over a dimmed and blurred Datasette table page. + :width: 550px + ``createModal(options)`` / ``DatasetteModal.create(options)`` accepts: ``id`` - string, optional