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

Bug 1849771: adding isGridstackRendering flag

to indicate the gridstack has finished loading
when running the behat tests

behatnotneeded

Change-Id: I2ab9f8962aa651c761175375047ee8d1ab1d2fe0
parent 1babdfd1
......@@ -11,6 +11,7 @@
*/
function loadGridTranslate(grid, blocks) {
var gridElements = [];
window.isGridstackRendering = true;
gridRemoveEvents();
// load grid with empty blocks
$.each(blocks, function(index, block) {
......@@ -40,12 +41,14 @@ function loadGridTranslate(grid, blocks) {
el.on('resizestop', resizeStopBlock);
});
initJs();
window.isGridstackRendering = false;
}, 300);
}
function loadGrid(grid, blocks) {
var minWidth = grid.opts.minCellColumns,
minHeight;
window.isGridstackRendering = true;
$.each(blocks, function(index, block) {
minHeight = null;
var blockContent = $('<div id="block_' + block.id + '"><div class="grid-stack-item-content">'
......@@ -68,6 +71,7 @@ function loadGrid(grid, blocks) {
if (typeof id === 'undefined') {
updateBlockSizes();
}
window.isGridstackRendering = false;
}, 300);
}
......
......@@ -32,12 +32,19 @@ window.isEditorInitializing = false;
*/
window.isModalRendering = false;
/**
* This variable determines if gridstack blocks have finished loading
* = true if it is in progress
*/
window.isGridstackRendering = false;
function isMaharaPageReady() {
return (window.isRequestProcessing === false)
&& (window.isPieformRendering === false)
&& (window.isEditorInitializing === false)
&& (window.isModalRendering === false)
&& (document.readyState === "complete");
&& (document.readyState === "complete")
&& (window.isGridstackRendering === false);
}
jQuery(function() {
......
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