Skip to content

Commit 0734850

Browse files
sjanuarymattcolegate
authored andcommitted
Fix issue where maximized table may be in the wrong place
1 parent b397417 commit 0734850

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

js/textTable.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,28 @@ function TextTable(divName, parentName, title) {
197197
}
198198

199199
function resizeTable() {
200-
let divCanvasWidth = $(divName).width() - 8; // -8 for margins and borders
201-
if (tableIsFullScreen) {
202-
tableHeight = $(divName).height() - 100;
203-
// If parent is a graph-container (Used to vertically group graphs) make position absolute
204-
if ($(divName).parent().hasClass('graph-container')) {
205-
$(divName).parent().attr('style', 'position: absolute');
206-
}
207-
} else {
208-
tableHeight = 250;
209-
if ($(divName).parent().hasClass('graph-container')) {
210-
$(divName).parent().attr('style', 'position: relative');
200+
if(!$(divName).hasClass('invisible')) {
201+
let divCanvasWidth = $(divName).width() - 8; // -8 for margins and borders
202+
if (tableIsFullScreen) {
203+
console.log("fullscreen: " + title)
204+
tableHeight = $(divName).height() - 100;
205+
// If parent is a graph-container (Used to vertically group graphs) make position absolute
206+
if ($(divName).parent().hasClass('graph-container')) {
207+
$(divName).parent().attr('style', 'position: absolute');
208+
}
209+
} else {
210+
tableHeight = 250;
211+
if ($(divName).parent().hasClass('graph-container')) {
212+
$(divName).parent().attr('style', 'position: relative');
213+
}
211214
}
215+
resizeImage.attr('x', divCanvasWidth - 30).attr('y', 4);
216+
svg.attr('width', divCanvasWidth).attr('height', tableHeight);
217+
titleBox.attr('width', divCanvasWidth);
218+
innerHTML.attr('width', divCanvasWidth)
219+
.attr('height', tableHeight - titleBoxHeight);
220+
checkTextOverflow();
212221
}
213-
resizeImage.attr('x', divCanvasWidth - 30).attr('y', 4);
214-
svg.attr('width', divCanvasWidth).attr('height', tableHeight);
215-
titleBox.attr('width', divCanvasWidth);
216-
innerHTML.attr('width', divCanvasWidth)
217-
.attr('height', tableHeight - titleBoxHeight);
218-
checkTextOverflow();
219222
}
220223

221224
let exports = {};

0 commit comments

Comments
 (0)