Skip to content

Commit

Permalink
Fix resizable (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein authored Jan 15, 2025
1 parent d3e8b0d commit ca4c39d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/lib/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class RemoteFrameBufferView extends DOMWidgetView {
this.el.style.width = this.model.get('css_width');
this.el.style.height = this.model.get('css_height');
this.el.style.resize = this.model.get('resizable') ? 'both' : 'none';
this.el.style.overflow = 'hidden'; // resize does not work if overflow is 'visible'

// Keep track of size changes from the server
this.model.on('change:css_width', function () { this.el.style.width = this.model.get('css_width'); }, this);
Expand Down Expand Up @@ -345,6 +346,7 @@ export class RemoteFrameBufferView extends DOMWidgetView {
// prevent massive size due to auto-scroll (issue #62)
this.el.style.maxWidth = Math.max(1024, window.innerWidth) + 'px';
this.el.style.maxHeight = Math.max(1024, window.innerHeight) + 'px';
this.el.style.overflow = 'hidden';
return; // Don't send a resize event now
}
// Width and height are in logical pixels.
Expand Down

0 comments on commit ca4c39d

Please sign in to comment.