Cards: Make the editing background fixed, to make it visible even with a scrolled viewport.

This commit is contained in:
2018-03-21 06:54:30 +01:00
parent d375904624
commit c5ba945b08
2 changed files with 4 additions and 3 deletions

View File

@@ -557,13 +557,14 @@ Card.prototype = {
this.divEditBackground = document.createElement("div");
this.divEditBackground.className = "divEditBackground";
this.divEditBackground.addEventListener("click", Card.prototype.btnEdit_Click.bind(this), false);
this.divCard.offsetParent.insertBefore(this.divEditBackground, this.divCard);
this.divCard.parentElement.insertBefore(this.divEditBackground, this.divCard);
},
ExitEditionMode: function () {
this.divOverlay.style.display = "";
this.Editing = false;
this.divEditBackground.offsetParent.removeChild(this.divEditBackground);
this.divEditBackground.className = ""; // Needed to remove "position: fixed" that causes to be not found on parentElement.
this.divEditBackground.parentElement.removeChild(this.divEditBackground);
},
btnEdit_Click: function (evt) {
evt.preventDefault();

View File

@@ -169,7 +169,7 @@
.divEditBackground {
display: block;
position: absolute;
position: fixed;
top: 0;
left: 0;
bottom: 0;