Skip to content

Commit

Permalink
Effort to fix periodic window sizing glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Jan 5, 2024
1 parent baa607a commit 7de1a25
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/analyze/html/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ function newwindow(id, title, content, height, width) {
var mywindow = $(`#windows #window_${id}`);
var itsnew = false;

var maxheight = $(window).height() * 0.8;
var maxwidth = $(window).width() * 0.5;
var maxheight = $(window).height() * 0.9;
var maxwidth = $(window).width() * 0.6;

// add the new one
if (mywindow.length == 0) {
Expand All @@ -103,6 +103,8 @@ function newwindow(id, title, content, height, width) {
</div>`
);

$('#windows').append(mywindow);

// roll up
// $('#rollup', mywindow).click(function (event) {
// $('#rollup-wrapper', $(this).parents('.window')).slideToggle('slow', 'swing');
Expand Down Expand Up @@ -132,7 +134,7 @@ function newwindow(id, title, content, height, width) {
resize: function (event, ui) {
console.log(event);
$('#contents', ui.element).width(ui.size.width-12);
$('#contents', ui.element).height(ui.size.height-$('#header', ui.element).height()-12);
$('#contents', ui.element).height(ui.size.height-$('#header', ui.element).height()-24);
},

maxHeight: maxheight,
Expand All @@ -155,16 +157,14 @@ function newwindow(id, title, content, height, width) {
mywindow.width(maxwidth)
}

$('#windows').append(mywindow);

// Fix initial content size

if ($('#contents', mywindow).width() > maxwidth-12) {
$('#contents', mywindow).width(maxwidth-12);
}

if ($('#contents', mywindow).height() > maxheight-$('#header', mywindow).height()-12) {
$('#contents', mywindow).height(maxheight-$('#header', mywindow).height()-12);
if ($('#contents', mywindow).height() > maxheight-$('#header', mywindow).height()-24) {
$('#contents', mywindow).height(maxheight-$('#header', mywindow).height()-24);
}
} else {
$('#title', mywindow).html(title);
Expand Down

0 comments on commit 7de1a25

Please sign in to comment.