You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2023/01/31 07:23:30 UTC
[ranger] branch ranger-2.4 updated: RANGER-4028: Ranger - Upgrade bootbox.js
This is an automated email from the ASF dual-hosted git repository.
ni3galave pushed a commit to branch ranger-2.4
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/ranger-2.4 by this push:
new 7c34c0857 RANGER-4028: Ranger - Upgrade bootbox.js
7c34c0857 is described below
commit 7c34c0857ea8a55b05374b5d794bc61832dee2b6
Author: Dhaval.Rajpara <dh...@gmail.com>
AuthorDate: Mon Jan 16 17:07:56 2023 +0530
RANGER-4028: Ranger - Upgrade bootbox.js
Signed-off-by: Nitin Galave <ni...@apache.org>
---
.../main/webapp/libs/bower/bootbox/js/bootbox.js | 35 +++++++++++++++-------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/security-admin/src/main/webapp/libs/bower/bootbox/js/bootbox.js b/security-admin/src/main/webapp/libs/bower/bootbox/js/bootbox.js
index 2d213e96d..e27cf404c 100644
--- a/security-admin/src/main/webapp/libs/bower/bootbox/js/bootbox.js
+++ b/security-admin/src/main/webapp/libs/bower/bootbox/js/bootbox.js
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.js
- * version: 5.4.0
+ * version: 5.5.3
* author: Nick Payne <ni...@kurai.co.uk>
* license: MIT
* http://bootboxjs.com/
@@ -65,7 +65,7 @@
var exports = {};
- var VERSION = '5.0.0';
+ var VERSION = '5.5.3';
exports.VERSION = VERSION;
var locales = {
@@ -154,7 +154,11 @@
// Append "multiple" property to the select when using the "prompt" helper
multiple: false,
// Automatically scroll modal content when height exceeds viewport height
- scrollable: false
+ scrollable: false,
+ // whether or not to destroy the modal on hide
+ reusable: false,
+ // the element that triggered the dialog opening
+ relatedTarget: null
};
@@ -383,8 +387,10 @@
// setup & teardown required after the underlying
// modal has performed certain actions.
- // make sure we unbind any listeners once the dialog has definitively been dismissed
- dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal);
+ if(!options.reusable) {
+ // make sure we unbind any listeners once the dialog has definitively been dismissed
+ dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal);
+ }
if (options.onHide) {
if ($.isFunction(options.onHide)) {
@@ -395,7 +401,9 @@
}
}
- dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal);
+ if(!options.reusable) {
+ dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal);
+ }
if (options.onHidden) {
if ($.isFunction(options.onHidden)) {
@@ -429,7 +437,7 @@
// Bootbox event listeners; used to decouple some
// behaviours from their respective triggers
- if (options.backdrop !== 'static') {
+ if (options.backdrop === true) {
// A boolean true/false according to the Bootstrap docs
// should show a dialog the user can dismiss by clicking on
// the background.
@@ -493,13 +501,13 @@
$(options.container).append(dialog);
dialog.modal({
- backdrop: options.backdrop ? 'static' : false,
+ backdrop: options.backdrop,
keyboard: false,
show: false
});
if (options.show) {
- dialog.modal('show');
+ dialog.modal('show', options.relatedTarget);
}
return dialog;
@@ -1064,12 +1072,19 @@
// make sure any supplied options take precedence over defaults
options = $.extend({}, defaults, options);
+ //make sure backdrop is either true, false, or 'static'
+ if (!options.backdrop) {
+ options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static';
+ } else {
+ options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true;
+ }
+
// no buttons is still a valid dialog but it's cleaner to always have
// a buttons object to iterate over, even if it's empty
if (!options.buttons) {
options.buttons = {};
}
-
+
buttons = options.buttons;
total = getKeyLength(buttons);