dialogsjs
v0.1.8
Published
Diálogos para web. Alerta, confirmações, aguardando, menu, etc.
Downloads
104
Maintainers
Readme
Dialogs
Dialogs for web and mobile
Dependency
Usage
Simple and beautiful.
Install
Using bower
bower install geidsonbc/dialogs --save
or npm
npm install dialogsjs
or yarn
yarn add dialogsjs
Setup
Include:
<script src="{your-url}/dialogs.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="{your-url}/dialogs.min.css">
Methods
dialog.waiting('Message');
dialog.confirm('Title', 'Message', function(){
// confirm
}, function(){// cancel
});dialog.prompt('Title', 'Message', 'Label', 'Selector', function(){
// done
}, function(){// cancel
});dialog.modal('Title', 'Message', function(){
...
});dialog.info('Title', 'Message', function(){
...
});dialog.help('Title', 'Message', { class:
...
, func:...
});dialog.menu('Title', [{ value:
...
, label:...
},...
], function(e){...
} );dialog.close('Type');
Examples
- Info
dialog.info('Titulo', 'Corpo', function() {
alert('callback');
});
- Confirm
dialog.confirm({
title: 'Titulo',
message: 'Corpo',
confirm: {
label: 'SIM',
event: function() {
alert('callback');
}
},
cancel: {
label: 'NÃO',
event: function() {
alert('callback');
}
}
});
Contributing
- Fork it!
- Create a new branch
- Commit your changes
- Push to the branch
- Submit a pull request :D
License
Licensed under the MIT License.