Skip to content

Commit

Permalink
Forgot this file in the commit
Browse files Browse the repository at this point in the history
  • Loading branch information
oxixes committed Oct 1, 2024
1 parent 8f152a2 commit db6bb8c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,14 @@
}, options);

layoutConfigs.forEach((layoutConfig) => {

Wirecloud.Utils.merge(layoutConfig, {
action: 'update',
width: resource.default_width,
anchor: 'top-left',
relx: true,
rely: false,
relwidth: true,
relheight: false,
titlevisible: true,
height: resource.default_height
});

Expand All @@ -302,6 +301,10 @@
avgScreenSize = layoutConfig.moreOrEqual;
}

if (layoutConfig.length === 0) {
avgScreenSize = window.innerWidth;
}

if (window.innerWidth >= layoutConfig.moreOrEqual && (layoutConfig.lessOrEqual === -1 || window.innerWidth <= layoutConfig.lessOrEqual)) {
avgScreenSize = window.innerWidth;
}
Expand Down Expand Up @@ -341,7 +344,7 @@

if (layoutConfig.left == null || layoutConfig.top == null) {
if (options.refposition && "searchBestPosition" in layout) {
layout.searchBestPosition(layoutConfig, avgScreenSize);
layout.searchBestPosition(options, layoutConfig, avgScreenSize);
} else if ("_searchFreeSpace2" in layout) {
const matrix = Wirecloud.Utils.getLayoutMatrix(layout, layout.dragboard.widgets, avgScreenSize);
const position = layout._searchFreeSpace2(layoutConfig.width, layoutConfig.height, matrix);
Expand Down

0 comments on commit db6bb8c

Please sign in to comment.