Commit a8b9bfb1 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1813987: many fixes for gridstack

- set min height for grid only in edit page,
so it won't show a lot of empty space for pages
with few blocks
- make the journal block resize when expanding
content
- [FOR TESTING!!] resize the block everytime
a collapsible is expanded or collapsed
inside the block. Need to check what happens
to the layout structure of the blocks that
are under the block that resizes.

behatnotneeded

Change-Id: I64925c1cb518af30f569ac2bbf69baea6c07ec05
parent f8ced5f7
......@@ -279,4 +279,7 @@ class PluginBlocktypeBlog extends MaharaCoreBlocktype {
}
}
public static function has_static_content() {
return false;
}
}
......@@ -90,7 +90,7 @@ function initJs() {
}
});
$(window).on('shown.bs.collapse', function(e) {
$(window).on('hidden.bs.collapse shown.bs.collapse', function(e) {
var grid = $(e.target).closest('.grid-stack');
var id = grid.attr('id');
//check we are not in timeline view
......@@ -182,7 +182,7 @@ function updateBlockSizes(grid) {
prevHeight = $(element).attr('data-gs-height'),
height = Math.ceil(
(
$(element).find('.grid-stack-item-content')[0].scrollHeight +
$(element).find('.grid-stack-item-content .gridstackblock')[0].scrollHeight +
grid.data('gridstack').opts.verticalMargin
)
/
......@@ -191,7 +191,7 @@ function updateBlockSizes(grid) {
grid.data('gridstack').opts.verticalMargin
)
);
if (+prevHeight < height) {
if (+prevHeight != height) {
grid.data('gridstack').resize(element, +width, height);
}
}
......
......@@ -15,7 +15,9 @@ $animation_speed: .3s !default;
.grid-stack {
position: relative;
min-height: 80vh;
&.gridedit {
min-height: 80vh;
}
&.grid-stack-rtl {
direction: ltr;
......
......@@ -49,7 +49,7 @@
<div class="col">
<div id="bottom-pane" data-role="workspace">
<div id="column-container" class="user-page-content">
<div class="grid-stack">
<div class="grid-stack gridedit">
</div>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment