Dialogs for web and mobile
Simple and beautiful.
Using bower
bower install geidsonbc/dialogs --save
or npm
npm install dialogsjs
or yarn
yarn add dialogsjs
Include:
<script src="{your-url}/dialogs.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="{your-url}/dialogs.min.css">
-
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');
- 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');
}
}
});
- Menu
dialog.menu('Title',
[
{
value: '1',
label: 'Opção 1'
},
{
value: '2',
label: 'Opção 2'
}
],
function (e) {
var value = $(e.currentTarget).data('value');
alert("Callback ao clicar na opção de valor " + value);
}
);
- Fork it!
- Create a new branch
- Commit your changes
- Push to the branch
- Submit a pull request :D
Licensed under the MIT License.