Skip to content

Commit

Permalink
fix scroll to bottom #777
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 13, 2022
1 parent 2ab19f5 commit 4cd792a
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.33.2
### Bugfix
* fix scroll to bottom [#777](https://github.com/jcubic/jquery.terminal/issues/777)

## 2.33.1
### Bugfix
* fix padding removed by minifier
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
__ / / // / // / _ / _/ // / / / _ / _/ / / \/ / _ \/ /
/ / / // / // / ___/ // // / / / ___/ // / / / / /\ / // / /__
\___/____ \\__/____/_/ \__ / /_/____/_//_/_/_/_/_/ \/\__\_\___/
\/ /____/ version 2.33.1
\/ /____/ version DEV
```

[JavaScript Library for Web Based Terminal Emulators](https://terminal.jcubic.pl)

[![npm](https://img.shields.io/badge/npm-2.33.1-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-2.33.1-yellow.svg)
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=master&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=master&c26faa3511e82bd2d51060e7a0bab729)](https://coveralls.io/github/jcubic/jquery.terminal?branch=master)
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&c26faa3511e82bd2d51060e7a0bab729)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
![downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
[![Paid Support](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded)](https://www.jsdelivr.com/package/npm/jquery.terminal)
[![](https://img.shields.io/badge/paid-support-354465.svg)](https://support.jcubic.pl/)
Expand Down Expand Up @@ -91,7 +91,7 @@ You can test current version at this URL:

or if it doesn't use latest version (because of jsDelivr cache) you can force it with this URL:

* [https://jcubic.github.io/jquery.terminal/?ver=2.33.1](https://jcubic.github.io/jquery.terminal/?ver=2.33.1)
* [https://jcubic.github.io/jquery.terminal/?ver=DEV](https://jcubic.github.io/jquery.terminal/?ver=DEV)

And development version using:

Expand All @@ -109,20 +109,20 @@ Include jQuery library, you can use cdn from https://jquery.com/download/

```

Then include js/jquery.terminal-2.33.1.min.js and css/jquery.terminal-2.33.1.min.css
Then include js/jquery.terminal-DEV.min.js and css/jquery.terminal-DEV.min.css

You can grab the files from CDN:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.33.1/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.33.1/css/jquery.terminal.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/js/jquery.terminal.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/DEV/css/jquery.terminal.min.css" rel="stylesheet"/>
```

or

```html
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.33.1/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.33.1/css/jquery.terminal.min.css">
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery.terminal@DEV/css/jquery.terminal.min.css">
```

If you always want latest version, you can get it from [unpkg](https://unpkg.com/) without specifying version,
Expand Down
12 changes: 6 additions & 6 deletions js/jquery.terminal-2.33.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.33.1
* \/ /____/ version DEV
*
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
*
Expand Down Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Thu, 05 May 2022 17:12:32 +0000
* Date: Fri, 13 May 2022 10:10:35 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5194,8 +5194,8 @@
}
// -------------------------------------------------------------------------
$.terminal = {
version: '2.33.1',
date: 'Thu, 05 May 2022 17:12:32 +0000',
version: 'DEV',
date: 'Fri, 13 May 2022 10:10:35 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -11104,9 +11104,9 @@
scroll_to_bottom: function() {
var scrollHeight;
if (self.prop) {
scrollHeight = self.prop('scrollHeight');
scrollHeight = scroller.prop('scrollHeight');
} else {
scrollHeight = self.attr('scrollHeight');
scrollHeight = scroller.attr('scrollHeight');
}
scroller.scrollTop(scrollHeight);
return self;
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal-2.33.1.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -11096,17 +11096,17 @@
// :: ref: https://stackoverflow.com/a/18927969/387194
// -------------------------------------------------------------
scroll_to: function(elem) {
var scroll = self.scrollTop() - self.offset().top + $(elem).offset().top;
self.scrollTop(scroll);
var scroll = scroller.scrollTop() - self.offset().top + $(elem).offset().top;
scroller.scrollTop(scroll);
return self;
},
// -------------------------------------------------------------
scroll_to_bottom: function() {
var scrollHeight;
if (self.prop) {
scrollHeight = self.prop('scrollHeight');
scrollHeight = scroller.prop('scrollHeight');
} else {
scrollHeight = self.attr('scrollHeight');
scrollHeight = scroller.attr('scrollHeight');
}
scroller.scrollTop(scrollHeight);
return self;
Expand All @@ -11122,9 +11122,9 @@
return is_bottom_detected;
} else {
var scroll_height, scroll_top, height;
scroll_height = self[0].scrollHeight;
scroll_top = self[0].scrollTop;
height = self[0].offsetHeight;
scroll_height = scroller[0].scrollHeight;
scroll_top = scroller[0].scrollTop;
height = scroller[0].offsetHeight;
var limit = scroll_height - settings.scrollBottomOffset;
return scroll_top + height > limit;
}
Expand Down
12 changes: 6 additions & 6 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 2.33.1
* \/ /____/ version DEV
*
* This file is part of jQuery Terminal. https://terminal.jcubic.pl
*
Expand Down Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Thu, 05 May 2022 17:12:32 +0000
* Date: Fri, 13 May 2022 10:10:35 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -5194,8 +5194,8 @@
}
// -------------------------------------------------------------------------
$.terminal = {
version: '2.33.1',
date: 'Thu, 05 May 2022 17:12:32 +0000',
version: 'DEV',
date: 'Fri, 13 May 2022 10:10:35 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -11104,9 +11104,9 @@
scroll_to_bottom: function() {
var scrollHeight;
if (self.prop) {
scrollHeight = self.prop('scrollHeight');
scrollHeight = scroller.prop('scrollHeight');
} else {
scrollHeight = self.attr('scrollHeight');
scrollHeight = scroller.attr('scrollHeight');
}
scroller.scrollTop(scrollHeight);
return self;
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 4cd792a

Please sign in to comment.