derby-ui-modal
Derby ui component: modal dialog.
Installation
npm install derby-ui-modal
In app.js:
var app;app = ;
Usage
In templates
White dialog
Content
Black dialog
Content
ESC will close the dialog
Content
data-action
parameter
Buttons will work too, but they need a Content Close Save
Naming it
Give it a name. This will create functions app.modal.my_dialog.show
and app.modal.my_dialog.close
which can be used in templates and in the code.
Listening to events
_page.modal.my_dialog
will be set or deleted when a modal is created/destroyed:
modelon 'change''_page.modal.my_dialog' if value consolelog 'modal created' else consolelog 'modal destroyed with action ' + passedaction
action.passed
is a parameter that can be set in a template:
Content Ok Close
Drawbacks/todo
Unfortunately you will have to provice the parameter bind="create:modal.create"
to the modal as of now.
Beware
The namespace ui2
will be changed later to ui
.