Skip to content

Commit

Permalink
Revert "updated package references"
Browse files Browse the repository at this point in the history
This reverts commit d1db8c0.

# Conflicts:
#	dist/css/bootstrap-dialog.css
#	dist/css/bootstrap-dialog.min.css
#	dist/js/bootstrap-dialog.js
#	src/scss/bootstrap-dialog.scss
  • Loading branch information
GedMarc committed May 1, 2020
1 parent 8d9093f commit 07f17b9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 34 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Version 4.3.4 - 1 May 2020

Bootstrap-Dialog for Bootstrap 4.3.1

## Fully compatible with Bootstrap 4.3.1
Expand Down Expand Up @@ -50,15 +52,15 @@ bower install bootstrap-dialog
Or

```
bower install bootstrap3-dialog
bower install bootstrap4-dialog#https://github.com/GedMarc/bootstrap4-dialog.git
```

================

## Install using npm

```
npm install --save bootstrap3-dialog
npm install --save bootstrap4-dialog
```

================
Expand Down
52 changes: 22 additions & 30 deletions dist/js/bootstrap-dialog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@

/* global define */

/* ================================================
* Make use of Bootstrap's modal more monkey-friendly.
*
* For Bootstrap 3.
*
* [email protected]
*
* https://github.com/nakupanda/bootstrap3-dialog
*
* Licensed under The MIT License.
* ================================================ */
(function (root, factory) {

"use strict";
Expand Down Expand Up @@ -322,13 +334,6 @@

BootstrapDialog.METHODS_TO_OVERRIDE = {};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.1'] = {
handleModalBackdropEvent: function () {
this.getModal().on('click', { dialog: this }, function (event) {
event.target === this && event.data.dialog.isClosable() && event.data.dialog.canCloseByBackdrop() && event.data.dialog.close();
});

return this;
},
/**
* To make multiple opened dialogs look better.
*
Expand Down Expand Up @@ -361,7 +366,6 @@
}
};
BootstrapDialog.METHODS_TO_OVERRIDE['v3.2'] = {
handleModalBackdropEvent: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['handleModalBackdropEvent'],
updateZIndex: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['updateZIndex'],
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open']
};
Expand All @@ -371,7 +375,6 @@
getModalBackdrop: function ($modal) {
return $($modal.data('bs.modal')._backdrop);
},
handleModalBackdropEvent: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['handleModalBackdropEvent'],
updateZIndex: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['updateZIndex'],
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open'],
getModalForBootstrapDialogModal: function () {
Expand All @@ -382,7 +385,6 @@
getModalBackdrop: function ($modal) {
return $($modal.data('bs.modal')._backdrop);
},
handleModalBackdropEvent: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['handleModalBackdropEvent'],
updateZIndex: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['updateZIndex'],
open: BootstrapDialog.METHODS_TO_OVERRIDE['v3.1']['open'],
getModalForBootstrapDialogModal: function () {
Expand Down Expand Up @@ -546,14 +548,14 @@
updateType: function () {
if (this.isRealized()) {
var types = [BootstrapDialog.TYPE_DEFAULT,
BootstrapDialog.TYPE_INFO,
BootstrapDialog.TYPE_PRIMARY,
BootstrapDialog.TYPE_SECONDARY,
BootstrapDialog.TYPE_SUCCESS,
BootstrapDialog.TYPE_WARNING,
BootstrapDialog.TYPE_DARK,
BootstrapDialog.TYPE_LIGHT,
BootstrapDialog.TYPE_DANGER];
BootstrapDialog.TYPE_INFO,
BootstrapDialog.TYPE_PRIMARY,
BootstrapDialog.TYPE_SECONDARY,
BootstrapDialog.TYPE_SUCCESS,
BootstrapDialog.TYPE_WARNING,
BootstrapDialog.TYPE_DARK,
BootstrapDialog.TYPE_LIGHT,
BootstrapDialog.TYPE_DANGER];

this.getModal().removeClass(types.join(' ')).addClass(this.getType());
}
Expand Down Expand Up @@ -1129,9 +1131,6 @@
}
});

// Backdrop, I did't find a way to change bs3 backdrop option after the dialog is popped up, so here's a new wheel.
this.handleModalBackdropEvent();

// ESC key support
this.getModal().on('keyup', { dialog: this }, function (event) {
event.which === 27 && event.data.dialog.isClosable() && event.data.dialog.canCloseByKeyboard() && event.data.dialog.close();
Expand All @@ -1148,13 +1147,6 @@

return this;
},
handleModalBackdropEvent: function () {
this.getModal().on('click', { dialog: this }, function (event) {
$(event.target).hasClass('modal-backdrop') && event.data.dialog.isClosable() && event.data.dialog.canCloseByBackdrop() && event.data.dialog.close();
});

return this;
},
isModalEvent: function (event) {
return typeof event.namespace !== 'undefined' && event.namespace === 'bs.modal';
},
Expand Down Expand Up @@ -1198,7 +1190,7 @@
this.getModalHeader().append(this.createHeaderContent());
this.getModalBody().append(this.createBodyContent());
this.getModal().data('bs.modal', new BootstrapDialogModal(this.getModalForBootstrapDialogModal(), { //FIXME for BootstrapV4
backdrop: 'static',
backdrop: (this.isClosable() && this.canCloseByBackdrop()) ? true : 'static',
keyboard: false,
show: false
}));
Expand Down
Loading

0 comments on commit 07f17b9

Please sign in to comment.