Cards: Editing background.

This commit is contained in:
2018-03-19 00:14:16 +01:00
parent af35be741c
commit 779b6154ee
2 changed files with 20 additions and 0 deletions

View File

@@ -545,15 +545,25 @@ Card.prototype = {
return false; return false;
}, },
EnterEditionMode: function () { EnterEditionMode: function () {
this.RemoveFromContainer();
this.InsertOnContainer(this.cfg.divBoard);
this.txtTitle.value = this.Title; this.txtTitle.value = this.Title;
this.txtBody.value = this.Body; this.txtBody.value = this.Body;
this.divOverlay.style.display = "none"; this.divOverlay.style.display = "none";
this.Editing = true; this.Editing = true;
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);
}, },
ExitEditionMode: function () { ExitEditionMode: function () {
this.divOverlay.style.display = ""; this.divOverlay.style.display = "";
this.Editing = false; this.Editing = false;
this.divEditBackground.offsetParent.removeChild(this.divEditBackground);
}, },
btnEdit_Click: function (evt) { btnEdit_Click: function (evt) {
evt.preventDefault(); evt.preventDefault();

View File

@@ -166,3 +166,13 @@
border: none; border: none;
resize: none; resize: none;
} }
.divEditBackground {
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.3);
}