Commit 3ab2c912 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1813987:testing removing float mode in grid layout

- remove the dotted line around the blocks in
page view mode
- if there are retractable sections inside the block,
retracting/collapsing them will hide/show the section,
not the block
- set float: false in group homepage, dashboard, profile page

behatnotneeded
Change-Id: I6f3fbc75331f95fb5be9721520d19b99ca43e3d2
parent a8b9bfb1
......@@ -90,8 +90,8 @@ if ($newlayout = $view->uses_new_layout()) {
$(function () {
var options = {
verticalMargin: 10,
float: true,
ddPlugin: false,
disableDrag : true,
disableResize: true,
};
var grid = $('.grid-stack');
grid.gridstack(options);
......
......@@ -58,8 +58,8 @@ if ($USER->is_logged_in()) {
$(function () {
var options = {
verticalMargin: 10,
float: true,
ddPlugin: false,
disableDrag : true,
disableResize: true,
};
var grid = $('.grid-stack');
grid.gridstack(options);
......
......@@ -102,6 +102,14 @@ function initJs() {
grid.gridstack();
updateBlockSizes(grid);
}
if (e.type == 'hidden' && $(e.target).hasClass('block')) {
var block = $(e.target).closest('.grid-stack-item');
grid.data('gridstack').resize(block, block.attr('data-gs-width'), 1);
}
else {
updateBlockSizes();
}
});
$(window).on('timelineviewresizeblocks', function() {
......@@ -177,7 +185,7 @@ function updateBlockSizes(grid) {
grid = $('.grid-stack');
}
$.each(grid.children(), function(index, element) {
if (!$(element).hasClass('staticblock')) {
// if (!$(element).hasClass('staticblock')) {
var width = $(element).attr('data-gs-width'),
prevHeight = $(element).attr('data-gs-height'),
height = Math.ceil(
......@@ -194,7 +202,7 @@ function updateBlockSizes(grid) {
if (+prevHeight != height) {
grid.data('gridstack').resize(element, +width, height);
}
}
//}
});
}
......
......@@ -17,6 +17,9 @@ $animation_speed: .3s !default;
position: relative;
&.gridedit {
min-height: 80vh;
.ui-draggable-handle {
border: 1px dashed lightgray;
}
}
&.grid-stack-rtl {
......@@ -108,10 +111,6 @@ $animation_speed: .3s !default;
}
}
> .ui-draggable-handle {
border: 1px dashed lightgray;
}
@for $i from 1 through $gridstack-columns {
&[data-gs-width='#{$i}'] { width: (100% / $gridstack-columns) * $i; }
&[data-gs-x='#{$i}'] { left: (100% / $gridstack-columns) * $i; }
......
......@@ -112,8 +112,8 @@ if (!$restrictedview) {
$(function () {
var options = {
verticalMargin: 10,
float: true,
ddPlugin: false,
disableDrag : true,
disableResize: true,
};
var grid = $('.grid-stack');
grid.gridstack(options);
......
......@@ -207,12 +207,10 @@ $blocks = $view->get_blocks(true);
$blocksencode = json_encode($blocks);
if ( $view->get('accessible')) {
$float = 'false';
$mincolumns = '12';
$reorder = ' accessibilityReorder();';
}
else {
$float = 'true';
$mincolumns = 'null';
$reorder = ' ';
}
......@@ -221,7 +219,6 @@ $blocksjs ="
$(function () {
var options = {
verticalMargin: 10,
float: {$float},
resizable: false,
acceptWidgets: '.blocktype-drag',
draggable: {
......
......@@ -368,8 +368,8 @@ if (!$USER->has_peer_role_only($view) || $view->has_peer_assessement_block()
$(function () {
var options = {
verticalMargin: 10,
float: true,
ddPlugin: false,
disableDrag : true,
disableResize: true,
};
var grid = $('.grid-stack');
grid.gridstack(options);
......
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