directus-extension-save-stay-button
v1.0.0
Published
Directus interface button that triggers the native save shortcut and stays on the current page.
Readme
Directus Extension Save Stay Button
A Directus interface that adds a save button to a form without leaving the current page.
The button simulates Directus' native Ctrl + S save shortcut, so the current item is saved while the user stays on the same view.
Features
- Adds a
save-stay-buttonpresentation interface - Displays a configurable "Save" button
- Triggers Directus' native save action through the keyboard shortcut
- Keeps the user on the current page after saving
Requirements
- Node.js
- Directus
^12.0.0 - npm
Local Installation
Install dependencies:
npm installBuild the extension:
npm run buildLink the extension to a local Directus instance:
npm run linkDuring development, you can run the build in watch mode:
npm run devUsage In Directus
- Restart Directus after installing or linking the extension.
- Open the data model settings.
- Add a presentation field.
- Select the "Save Button" interface.
- Configure the button label if needed.
Project Structure
src/index.js Extension source code
package.json npm and Directus extension configuration
package-lock.json Locked dependency versionsThe dist/ directory is generated by npm run build and is not committed.
Scripts
npm run build # Compile the extension into dist/
npm run dev # Compile in watch mode without minification
npm run link # Link the extension to Directus for local development