cinera_clear.js: Fix the placement of the clear

This commit is contained in:
Matt Mascarenhas 2021-06-11 17:39:48 +01:00
parent 209979f63a
commit 744515dac4
3 changed files with 17 additions and 10 deletions

View File

@ -23,7 +23,7 @@ typedef struct
version CINERA_APP_VERSION = { version CINERA_APP_VERSION = {
.Major = 0, .Major = 0,
.Minor = 8, .Minor = 8,
.Patch = 21 .Patch = 22
}; };
#include <stdarg.h> // NOTE(matt): varargs #include <stdarg.h> // NOTE(matt): varargs
@ -14220,11 +14220,11 @@ SearchToBuffer(buffers *CollationBuffers, db_header_project *StoredP, project *P
AppendStringToBuffer(B, Wrap0("\n")); AppendStringToBuffer(B, Wrap0("\n"));
OpenNodeCNewLine(B, &IndentationLevel, NODE_DIV, "cineraIndexList");
asset *JSClear = GetAsset(Wrap0(BuiltinAssets[ASSET_JS_CLEAR].Filename), ASSET_JS); asset *JSClear = GetAsset(Wrap0(BuiltinAssets[ASSET_JS_CLEAR].Filename), ASSET_JS);
AppendScriptNode(B, &URL, &IndentationLevel, JSClear, FALSE, PAGE_SEARCH); AppendScriptNode(B, &URL, &IndentationLevel, JSClear, FALSE, PAGE_SEARCH);
OpenNodeCNewLine(B, &IndentationLevel, NODE_DIV, "cineraIndexList");
AppendLandmarkedBuffer(B, &Index, PAGE_SEARCH); AppendLandmarkedBuffer(B, &Index, PAGE_SEARCH);
FreeBuffer(&Index); FreeBuffer(&Index);

View File

@ -1,16 +1,23 @@
// NOTE(matt): To use, source this file inside the element you wish to be obscured while processing occurs.
// After processing is complete, call FlipClear()
var ThisScriptElement = document.currentScript;
var NodeToHide = ThisScriptElement.parentNode;
var CineraClearElement = document.createElement("DIV"); var CineraClearElement = document.createElement("DIV");
CineraClearElement.style.position = "fixed"; CineraClearElement.style.position = "fixed";
CineraClearElement.style.height = "100%"; CineraClearElement.style.height = "100%";
CineraClearElement.style.width = "100%"; CineraClearElement.style.width = "100%";
CineraClearElement.style.zIndex = 64; CineraClearElement.style.zIndex = 64;
var CineraPlacedClear = document.body.appendChild(CineraClearElement);
var Col = getBackgroundColourRGB(CineraPlacedClear); var CineraPlacedClear = NodeToHide.appendChild(CineraClearElement);
CineraPlacedClear.style.background = "rgb(" + Col.R + ", " + Col.G + ", " + Col.B + ")" var Colour = getBackgroundColourRGB(CineraPlacedClear);
CineraPlacedClear.style.background = "rgb(" + Colour.R + ", " + Colour.G + ", " + Colour.B + ")"
document.body.style.overflowY = "hidden"; document.body.style.overflowY = "hidden";
function function
FlipClear() FlipClear(BodyOverflowY)
{ {
document.body.style.overflowY = null; document.body.style.overflowY = BodyOverflowY ? BodyOverflowY : null;
document.body.removeChild(CineraPlacedClear); CineraPlacedClear.parentNode.removeChild(CineraPlacedClear);
} }

View File

@ -45,7 +45,7 @@ InitPrototypes(Search.ResultsContainer);
prepareProjects(); prepareProjects();
SyncNavState(); SyncNavState();
FlipClear(); FlipClear("scroll");
// //
//// ////