Skip to content

Commit

Permalink
A little bit of cleanup
Browse files Browse the repository at this point in the history
Bumps version number.
Fixes unit tests.
Moves backdrop fix - was inserted between the button validation.
  • Loading branch information
tiesont committed Sep 29, 2020
1 parent f079264 commit 61933f2
Show file tree
Hide file tree
Showing 13 changed files with 530 additions and 875 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 5.4.0 (Latest Release)
## 5.4.1 (Latest Release)

- Updates to how backdrop is handled. Fixes #766.

### 5.4.0

- Adds function hooks for `onShow`, `onShown`, `onHide`, and `onHidden` events, which map to their Bootstrap modal equivalents.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(The MIT License)

Copyright (C) 2011-2019 by Nick Payne <[email protected]>
Copyright (C) 2011-2020 by Nick Payne <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Bootbox **3.3.0** is the *last* release to support Bootstrap 2.2.x.

Much more dependency information can be found [on the Bootbox website](http://bootboxjs.com/getting-started.html#bootbox-dependencies).

## 5.4.0 (Latest Release)
## 5.4.1 (Latest Release)

- Adds function hooks for `onShow`, `onShown`, `onHide`, and `onHidden` events, which map to their Bootstrap modal equivalents.
- Updates to how backdrop is handled. Fixes #766.

For a full list of releases and changes please see [the changelog](https://github.com/makeusabrew/bootbox/blob/master/CHANGELOG.md).

Expand Down
9 changes: 8 additions & 1 deletion bootbox.all.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.js
* version: 5.4.0
* version: 5.4.1
* author: Nick Payne <[email protected]>
* license: MIT
* http://bootboxjs.com/
Expand Down Expand Up @@ -1259,6 +1259,13 @@
// 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) {
Expand Down
15 changes: 8 additions & 7 deletions bootbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.js
* version: 5.4.0
* version: 5.4.1
* author: Nick Payne <[email protected]>
* license: MIT
* http://bootboxjs.com/
Expand Down Expand Up @@ -1064,17 +1064,18 @@
// make sure any supplied options take precedence over defaults
options = $.extend({}, defaults, options);

// 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 = {};
}
//make sure backdrop is either true/false/static
//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;

Expand Down
2 changes: 1 addition & 1 deletion bootbox.locales.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.locales.js
* version: 5.4.0
* version: 5.4.1
* author: Nick Payne <[email protected]>
* license: MIT
* http://bootboxjs.com/
Expand Down
4 changes: 2 additions & 2 deletions dist/bootbox.all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bootbox.locales.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/bootbox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* bootbox.js 5.4.0
* bootbox.js 5.4.1
*
* http://bootboxjs.com/license.txt
*/
Loading

0 comments on commit 61933f2

Please sign in to comment.