Skip to content

Commit a99102b

Browse files
causzticgsamokovarov
authored andcommitted
Prevent over resize (#276)
1 parent 10c2ea3 commit a99102b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/web_console/templates/console.js.erb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,13 @@ REPLConsole.prototype.install = function(container) {
380380
var clientHeightStart = consoleOuter.clientHeight;
381381

382382
var doDrag = function(e) {
383-
container.style.height = (startHeight + startY - e.clientY) + 'px';
383+
var height = startHeight + startY - e.clientY;
384384
consoleOuter.scrollTop = scrollTopStart + (clientHeightStart - consoleOuter.clientHeight);
385+
if (height > document.documentElement.clientHeight) {
386+
container.style.height = document.documentElement.clientHeight;
387+
} else {
388+
container.style.height = height + 'px';
389+
}
385390
shiftConsoleActions();
386391
};
387392

0 commit comments

Comments
 (0)