Skip to content

Commit

Permalink
Adds rows as an option when using a textarea prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
tiesont committed Apr 14, 2019
1 parent 5cdf405 commit 2c0dd37
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 5.1.0 (Latest Release)
## 5.1.1 (Latest Release)

- Adds `rows` as a prompt option when setting `inputType` to `textarea`.

### 5.1.0

- Adds `scrollable` option, which enables the scrollable modal content added in Bootstrap 4.3
- Adds `extra-large` as a size option
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ 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.1.0 (Latest Release)
### 5.1.1 (Latest Release)

- Adds `rows` as a prompt option when setting `inputType` to `textarea`.

#### 5.1.0

- Adds `scrollable` option, which enables the scrollable modal content added in Bootstrap 4.3
- Adds `extra-large` as a size option
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.1.0
* bootbox.js 5.1.1
*
* http://bootboxjs.com/license.txt
*/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootbox",
"version": "5.1.0",
"version": "5.1.1",
"description": "Wrappers for JavaScript alert(), confirm() and other flexible dialogs using the Bootstrap framework",
"directories": {
"test": "tests"
Expand Down
6 changes: 6 additions & 0 deletions src/bootbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@
if (options.required) {
input.prop({ 'required': true });
}

if (options.rows && !isNaN(parseInt(options.rows))) {
if(options.inputType === 'textarea'){
input.attr({ 'rows': options.rows });
}
}

break;

Expand Down
20 changes: 19 additions & 1 deletion tests/prompt.test.js

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

0 comments on commit 2c0dd37

Please sign in to comment.