Skip to content

Commit

Permalink
update bootstrap-dialog to v1.35.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Mar 30, 2017
1 parent 988a2dd commit a3675aa
Showing 1 changed file with 37 additions and 22 deletions.
59 changes: 37 additions & 22 deletions external/jquery/addons/js/bootstrap-dialog.js
Expand Up @@ -776,7 +776,7 @@
createCloseButton: function () {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('close-button'));
var $icon = $('<button class="close"></button>');
var $icon = $('<button class="close" aria-label="close"></button>');
$icon.append(this.options.closeIcon);
$container.append($icon);
$container.on('click', {dialog: this}, function (event) {
Expand Down Expand Up @@ -837,13 +837,25 @@
$button.append(button.label);
}

// title
if (typeof button.title !== 'undefined') {
$button.attr('title', button.title);
}

// Css class
if (typeof button.cssClass !== 'undefined' && $.trim(button.cssClass) !== '') {
$button.addClass(button.cssClass);
} else {
$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;
Expand Down Expand Up @@ -1062,6 +1074,9 @@
$(this).remove();
}
BootstrapDialog.moveFocus();
if ($('.modal').hasClass('in')) {
$('body').addClass('modal-open');
}
});

// Backdrop, I did't find a way to change bs3 backdrop option after the dialog is popped up, so here's a new wheel.
Expand Down Expand Up @@ -1302,31 +1317,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);
Expand Down

0 comments on commit a3675aa

Please sign in to comment.