Skip to content

Commit

Permalink
fix 2 issues with function saveTableWidths() in develop:
Browse files Browse the repository at this point in the history
-same column data will be written to local storage twice due to nestling of a table tag within a div container because both are having the same class ".cactiTable".
-items.length is always 1, this avoids a faultless initialization if storage key has not been set yet.
  • Loading branch information
browniebraun committed Mar 11, 2024
1 parent 11aeacb commit 72e75c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,7 @@ function saveTableWidths(initial) {
var key;

// Initialize table width on the page
$('.cactiTable').each(function (data) {
$('table.cactiTable').each(function (data) {
var key = $(this).attr('id');

if (storage.isSet(key)) {
Expand Down Expand Up @@ -3086,7 +3086,7 @@ function saveTableWidths(initial) {
sizes[0] = width;

if (key !== undefined) {
if (initial && items.length) {
if (initial && items.length > 1) {
$('#' + key).find('th.ui-resizable').each(function (data) {
if (items[i] == 0) {
items[i] = $(this).width();
Expand Down

0 comments on commit 72e75c0

Please sign in to comment.