From a3675aa7e317fea6d1924cd2c9b03f15fc207965 Mon Sep 17 00:00:00 2001 From: dleffler Date: Thu, 30 Mar 2017 15:19:23 -0400 Subject: [PATCH] update bootstrap-dialog to v1.35.4 --- external/jquery/addons/js/bootstrap-dialog.js | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/external/jquery/addons/js/bootstrap-dialog.js b/external/jquery/addons/js/bootstrap-dialog.js index ea11ffded4..a5edc4c045 100644 --- a/external/jquery/addons/js/bootstrap-dialog.js +++ b/external/jquery/addons/js/bootstrap-dialog.js @@ -776,7 +776,7 @@ createCloseButton: function () { var $container = $('
'); $container.addClass(this.getNamespace('close-button')); - var $icon = $(''); + var $icon = $(''); $icon.append(this.options.closeIcon); $container.append($icon); $container.on('click', {dialog: this}, function (event) { @@ -837,6 +837,11 @@ $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); @@ -844,6 +849,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; @@ -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. @@ -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);