-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customized alert and confirm dialogs: Add more options #144
Comments
Customized confirm dialog: An option for swapping the places of OK and Cancel buttons: |
|
Is it still important to you to have the option setting order of buttons of confirm dialog? If so I will add it tomorrow. |
It is not that urgent. Currently I use a custom dialog for confirmations like this one (Twig parser code): $('body').on('click', '.delete_file_action', function(e) {
var href = $(this).attr('href');
BootstrapDialog.show({
title: '{{ lang('ui_confirm')|e('js') }}',
message: '{{ lang('ui_confirm_file_deletion', '<strong>' ~ filename ~ '</strong>')|e('js') }}',
type: BootstrapDialog.TYPE_DANGER,
buttons: [{
label: '{{ lang('ui_yes')|e('js') }}',
icon: 'fa fa-check fa-fw',
cssClass: 'btn-danger',
action: function(dialog) {
dialog.close();
window.location.href = href;
}
}, {
label: '{{ lang('ui_no')|e('js') }}',
icon: 'fa fa-ban fa-fw',
action: function(dialog) {
dialog.close();
}
}]
});
e.preventDefault();
return false;
}); It says "Do you really want to delete the file" with the buttons YES NO. It works, but code is verbose. Nothing urgent. |
OK, it looks good too. |
Hi Nakupanda, |
Can't believe I haven't done it.. |
Here is a new option added to bootstrap-dialog about buttons order:
The option affects the buttons order of BootstrapDialog.confirm() currently, this is also the only method that has two pre-defined buttons. It's not in the latest release yet, you can download the latest archive of Master branch here and have a try https://github.com/nakupanda/bootstrap3-dialog/archive/master.zip How to use:
Or
|
Amazing 👍 Thanks so much Nakupanda :-) |
No problem. Time to close this issue. |
Uncaught TypeError: BootstrapDialog.show is not a function is coming while using requiredjs (document).on('click','.delete-fvrt',function (){
var dialogInstance5 = new BootstrapDialog.show({
}); |
size
btnOKIcon
btnCancelIcon
The text was updated successfully, but these errors were encountered: