Cards: Make the editing background fixed, to make it visible even with a scrolled viewport.
This commit is contained in:
@@ -557,13 +557,14 @@ Card.prototype = {
|
|||||||
this.divEditBackground = document.createElement("div");
|
this.divEditBackground = document.createElement("div");
|
||||||
this.divEditBackground.className = "divEditBackground";
|
this.divEditBackground.className = "divEditBackground";
|
||||||
this.divEditBackground.addEventListener("click", Card.prototype.btnEdit_Click.bind(this), false);
|
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 () {
|
ExitEditionMode: function () {
|
||||||
this.divOverlay.style.display = "";
|
this.divOverlay.style.display = "";
|
||||||
this.Editing = false;
|
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) {
|
btnEdit_Click: function (evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
|
|
||||||
.divEditBackground {
|
.divEditBackground {
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user