Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill the empty spaces when computing alignment while expanded [PREVIEW] #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/view/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,13 @@ function eval_pyson(value){
cell.css('vertical-align', yalign);
}

if (attributes.yfill) {
cell.addClass('yfill');
if (attributes.yexpand) {
widget.el.css('height', '100%');
}
}

if (attributes.help) {
widget.el.attr('title', attributes.help);
}
Expand All @@ -600,6 +607,12 @@ function eval_pyson(value){
}
});

var get_y_size = function(row) {
row = jQuery(row);
return row.children(':not(.yfill)').toArray().reduce(
(acc, element) => Math.max(acc, element.clientHeight),
0);
};
var get_xexpands = function(row) {
row = jQuery(row);
var xexpands = [];
Expand Down Expand Up @@ -667,6 +680,8 @@ function eval_pyson(value){
}
for (let row of rows) {
row = jQuery(row);
row.children('.yfill').css('height', '');
var y_size = get_y_size(row);
let i = 0;
for (let cell of row.children()) {
cell = jQuery(cell);
Expand All @@ -688,6 +703,18 @@ function eval_pyson(value){
} else {
cell.css('width', '');
}
if ((y_size > 0) &&
cell.hasClass('yfill') &&
(cell.children(':not(.tooltip)').css('display') !=
'none')) {
cell.css('height', y_size + 'px');
// Override max-height set in sao.css required to have a
// scrollbar
cell.find('.treeview, .list-form').first().css(
'max-height', y_size + 'px');
} else {
cell.css('height', '');
}
// show/hide when container is horizontal or vertical
// to not show padding
if (cell.children().css('display') == 'none') {
Expand Down