Skip to content

Commit

Permalink
fix resize for echo jQuery objects with events
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 5, 2019
1 parent a9a4eb9 commit ebe7f37
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 12 deletions.
15 changes: 12 additions & 3 deletions js/jquery.terminal-2.8.0.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Tue, 29 Oct 2019 20:39:25 +0000
* Date: Tue, 05 Nov 2019 14:09:16 +0000
*/
/* global location, setTimeout, window, global, sprintf, setImmediate,
IntersectionObserver, ResizeObserver, module, require, define,
Expand Down Expand Up @@ -4062,7 +4062,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Tue, 29 Oct 2019 20:39:25 +0000',
date: 'Tue, 05 Nov 2019 14:09:16 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -5919,7 +5919,16 @@
var settings = $.extend({}, options, {
raw: true,
finalize: function(div) {
div.find('.terminal-render-item').replaceWith(value);
var node;
if (value instanceof $.fn.init) {
// deep clone with events
node = value.clone(true, true);
} else {
// don't clone html nodes because it will not
// work for canvas or video tag
node = value;
}
div.find('.terminal-render-item').replaceWith(node);
if (options && is_function(options.finalize)) {
options.finalize(div, self);
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.8.0.min.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion js/jquery.terminal-src.js
Expand Up @@ -5919,7 +5919,16 @@
var settings = $.extend({}, options, {
raw: true,
finalize: function(div) {
div.find('.terminal-render-item').replaceWith(value);
var node;
if (value instanceof $.fn.init) {
// deep clone with events
node = value.clone(true, true);
} else {
// don't clone html nodes because it will not
// work for canvas or video tag
node = value;
}
div.find('.terminal-render-item').replaceWith(node);
if (options && is_function(options.finalize)) {
options.finalize(div, self);
}
Expand Down
15 changes: 12 additions & 3 deletions js/jquery.terminal.js
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Tue, 29 Oct 2019 20:39:25 +0000
* Date: Tue, 05 Nov 2019 14:09:16 +0000
*/
/* global location, setTimeout, window, global, sprintf, setImmediate,
IntersectionObserver, ResizeObserver, module, require, define,
Expand Down Expand Up @@ -4062,7 +4062,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Tue, 29 Oct 2019 20:39:25 +0000',
date: 'Tue, 05 Nov 2019 14:09:16 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -5919,7 +5919,16 @@
var settings = $.extend({}, options, {
raw: true,
finalize: function(div) {
div.find('.terminal-render-item').replaceWith(value);
var node;
if (value instanceof $.fn.init) {
// deep clone with events
node = value.clone(true, true);
} else {
// don't clone html nodes because it will not
// work for canvas or video tag
node = value;
}
div.find('.terminal-render-item').replaceWith(node);
if (options && is_function(options.finalize)) {
options.finalize(div, self);
}
Expand Down
4 changes: 2 additions & 2 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 ebe7f37

Please sign in to comment.