Fixed window resize/client bug

This commit is contained in:
Robert L 2018-01-17 21:48:41 -05:00
parent b121d7a09d
commit 7951bd0477
3 changed files with 19 additions and 7 deletions

View File

@ -132,7 +132,7 @@
</div> </div>
<div id="client"> <div id="client">
<div id="client-bar"> <div id="client-bar">
<span class="client-bar-control-container"> <span class="client-bar-control-container handle">
<a href="#" id="client-bar-control"><i id="client-ico-up" class="fa fa-chevron-up" aria-hidden="true"></i><i id="client-ico-down" class="fa fa-chevron-down hidden" aria-hidden="true"></i><b id="client-tab-desc">Client</b></a> <a href="#" id="client-bar-control"><i id="client-ico-up" class="fa fa-chevron-up" aria-hidden="true"></i><i id="client-ico-down" class="fa fa-chevron-down hidden" aria-hidden="true"></i><b id="client-tab-desc">Client</b></a>
</span> </span>
</div> </div>

View File

@ -1,4 +1,16 @@
var lastInputBox; var lastInputBox;
$.widget("ui.resizable", $.ui.resizable, {
resizeBy: function(newSize) {
this._mouseStart($.Event("mousedown", { pageX: 0, pageY: 0 }));
this.axis = 'se';
var end = $.Event("mouseup", {
pageX: newSize.width,
pageY: newSize.height
});
this._mouseDrag(end);
this._mouseStop(end);
}
});
$(document).ready(function() { $(document).ready(function() {
// Controls menu hide/show // Controls menu hide/show
@ -70,7 +82,7 @@ $(document).ready(function() {
$('#client-login').click(function() { reconnect();}) $('#client-login').click(function() { reconnect();})
$(".vertical-resize").resizable({ $(".vertical-resize").resizable({
handles: { handles: {
'n': '#client-term-resize' 'n': '.handle'
}, },
alsoResize: "#client-term-output", alsoResize: "#client-term-output",
minWidth: "100%", minWidth: "100%",
@ -95,9 +107,9 @@ $(document).ready(function() {
}); });
$(window).resize(function() { $(window).resize(function() {
$('.vertical-resize').resizable( "option", "maxHeight", ($(window).height() * 0.95) ); $('.vertical-resize').resizable( "option", "maxHeight", ($('.vertical-resize').parent().parent().height() * 0.95) );
if($('.vertical-resize').height() > ($(window).height() * 0.95) ) { if($('.vertical-resize').height() > ($('.vertical-resize').parent().parent().height() * 0.95) ) {
$('.vertical-resize').height(($(window).height() * 0.95)); $('.vertical-resize').resizable("resizeBy", {height: '95%', width:'100%'});
} }
}); });
// Websocket client startup // Websocket client startup

View File

@ -134,7 +134,7 @@ input[type=radio]:checked + label:before {
#client-tab-desc{ padding-left: 0.5vw;} #client-tab-desc{ padding-left: 0.5vw;}
#client-term-container { #client-term-container {
height: 40vh; height: 40%;
width: 100%; width: 100%;
background-color: black; background-color: black;
} }
@ -154,7 +154,7 @@ input[type=radio]:checked + label:before {
} }
#client-term-prompt { #client-term-prompt {
width: 100%; width: 100%;
height: 0.9vh; height: 1em;
overflow: hidden; overflow: hidden;
white-space: pre-wrap; white-space: pre-wrap;
text-align: left; text-align: left;