|
|
@@ -844,6 +844,13 @@
|
|
|
$button.addClass('btn-default');
|
|
|
}
|
|
|
|
|
|
+ // Data attributes
|
|
|
+ if (typeof button.data === 'object' && button.data.constructor === {}.constructor) {
|
|
|
+ $.each(button.data, function (key, value) {
|
|
|
+ $button.attr('data-' + key, value);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// Hotkey
|
|
|
if (typeof button.hotkey !== 'undefined') {
|
|
|
this.registeredButtonHotkeys[button.hotkey] = $button;
|
|
|
@@ -1302,31 +1309,31 @@
|
|
|
|
|
|
var dialog = new BootstrapDialog(confirmOptions);
|
|
|
dialog.setData('callback', confirmOptions.callback);
|
|
|
-
|
|
|
+
|
|
|
var buttons = [{
|
|
|
- label: confirmOptions.btnCancelLabel,
|
|
|
- cssClass: confirmOptions.btnCancelClass,
|
|
|
- hotkey: confirmOptions.btnCancelHotkey,
|
|
|
- action: function (dialog) {
|
|
|
- if (typeof dialog.getData('callback') === 'function' && dialog.getData('callback').call(this, false) === false) {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ label: confirmOptions.btnCancelLabel,
|
|
|
+ cssClass: confirmOptions.btnCancelClass,
|
|
|
+ hotkey: confirmOptions.btnCancelHotkey,
|
|
|
+ action: function (dialog) {
|
|
|
+ if (typeof dialog.getData('callback') === 'function' && dialog.getData('callback').call(this, false) === false) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- return dialog.close();
|
|
|
- }
|
|
|
- }, {
|
|
|
- label: confirmOptions.btnOKLabel,
|
|
|
- cssClass: confirmOptions.btnOKClass,
|
|
|
- hotkey: confirmOptions.btnOKHotkey,
|
|
|
- action: function (dialog) {
|
|
|
- if (typeof dialog.getData('callback') === 'function' && dialog.getData('callback').call(this, true) === false) {
|
|
|
- return false;
|
|
|
+ return dialog.close();
|
|
|
}
|
|
|
+ }, {
|
|
|
+ label: confirmOptions.btnOKLabel,
|
|
|
+ cssClass: confirmOptions.btnOKClass,
|
|
|
+ hotkey: confirmOptions.btnOKHotkey,
|
|
|
+ action: function (dialog) {
|
|
|
+ if (typeof dialog.getData('callback') === 'function' && dialog.getData('callback').call(this, true) === false) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- return dialog.close();
|
|
|
- }
|
|
|
- }];
|
|
|
- if(confirmOptions.btnsOrder === BootstrapDialog.BUTTONS_ORDER_OK_CANCEL) {
|
|
|
+ return dialog.close();
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ if (confirmOptions.btnsOrder === BootstrapDialog.BUTTONS_ORDER_OK_CANCEL) {
|
|
|
buttons.reverse();
|
|
|
}
|
|
|
dialog.addButtons(buttons);
|