Cards: Fix card Z ordering
This commit is contained in:
@@ -125,6 +125,8 @@ namespace VAR.Focus.Web.Code.BusinessLogic
|
|||||||
card.Y = y;
|
card.Y = y;
|
||||||
card.ModifiedBy = currentUserName;
|
card.ModifiedBy = currentUserName;
|
||||||
card.ModifiedDate = currentDate;
|
card.ModifiedDate = currentDate;
|
||||||
|
_cards.Remove(card);
|
||||||
|
_cards.Add(card);
|
||||||
|
|
||||||
// Create event
|
// Create event
|
||||||
_lastIDCardEvent++;
|
_lastIDCardEvent++;
|
||||||
@@ -156,6 +158,8 @@ namespace VAR.Focus.Web.Code.BusinessLogic
|
|||||||
card.Body = body;
|
card.Body = body;
|
||||||
card.ModifiedBy = currentUserName;
|
card.ModifiedBy = currentUserName;
|
||||||
card.ModifiedDate = currentDate;
|
card.ModifiedDate = currentDate;
|
||||||
|
_cards.Remove(card);
|
||||||
|
_cards.Add(card);
|
||||||
|
|
||||||
// Create event
|
// Create event
|
||||||
_lastIDCardEvent++;
|
_lastIDCardEvent++;
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ var Toolbox = function (cfg, container) {
|
|||||||
this.offsetY = 0;
|
this.offsetY = 0;
|
||||||
};
|
};
|
||||||
Toolbox.prototype = {
|
Toolbox.prototype = {
|
||||||
|
ReInsertOnContainer: function () {
|
||||||
|
this.container.removeChild(this.divToolbox);
|
||||||
|
this.container.appendChild(this.divToolbox);
|
||||||
|
},
|
||||||
GetRelativePosToContainer: function (pos) {
|
GetRelativePosToContainer: function (pos) {
|
||||||
var tempElem = this.container;
|
var tempElem = this.container;
|
||||||
var relPos = { x: pos.x, y: pos.y };
|
var relPos = { x: pos.x, y: pos.y };
|
||||||
@@ -211,6 +215,7 @@ Card.prototype = {
|
|||||||
InsertInContainer: function (container) {
|
InsertInContainer: function (container) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.container.appendChild(this.divCard);
|
this.container.appendChild(this.divCard);
|
||||||
|
this.cfg.Toolbox.ReInsertOnContainer();
|
||||||
},
|
},
|
||||||
RemoveFromContainer: function(){
|
RemoveFromContainer: function(){
|
||||||
this.container.removeChild(this.divCard);
|
this.container.removeChild(this.divCard);
|
||||||
@@ -236,6 +241,7 @@ Card.prototype = {
|
|||||||
this.animData = null;
|
this.animData = null;
|
||||||
},
|
},
|
||||||
Move: function (x, y) {
|
Move: function (x, y) {
|
||||||
|
this.OnMoveStart();
|
||||||
this.X = x;
|
this.X = x;
|
||||||
this.Y = y;
|
this.Y = y;
|
||||||
this.newX = x;
|
this.newX = x;
|
||||||
@@ -262,6 +268,8 @@ Card.prototype = {
|
|||||||
this.newBody = body;
|
this.newBody = body;
|
||||||
this.divTitle.innerHTML = this.FilterText(this.Title);
|
this.divTitle.innerHTML = this.FilterText(this.Title);
|
||||||
this.divBody.innerHTML = this.FilterText(this.Body);
|
this.divBody.innerHTML = this.FilterText(this.Body);
|
||||||
|
this.RemoveFromContainer();
|
||||||
|
this.InsertInContainer(this.cfg.divBoard);
|
||||||
},
|
},
|
||||||
Reset: function () {
|
Reset: function () {
|
||||||
this.newX = this.X;
|
this.newX = this.X;
|
||||||
@@ -294,36 +302,36 @@ Card.prototype = {
|
|||||||
window.clearTimeout(this.animData.animationID);
|
window.clearTimeout(this.animData.animationID);
|
||||||
this.animData = null;
|
this.animData = null;
|
||||||
}
|
}
|
||||||
|
this.RemoveFromContainer();
|
||||||
|
this.InsertInContainer(this.cfg.divBoard);
|
||||||
},
|
},
|
||||||
OnMove: function () {
|
OnMove: function () {
|
||||||
if (this.X != this.newX || this.Y != this.newY) {
|
var card = this;
|
||||||
var card = this;
|
if (this.cfg.Connected == false) {
|
||||||
if (this.cfg.Connected == false) {
|
card.Reset();
|
||||||
card.Reset();
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
var data = {
|
|
||||||
"IDBoard": this.cfg.IDBoard,
|
|
||||||
"Command": "Move",
|
|
||||||
"IDCard": this.IDCard,
|
|
||||||
"X": this.newX,
|
|
||||||
"Y": this.newY,
|
|
||||||
"TimeStamp": new Date().getTime()
|
|
||||||
};
|
|
||||||
SendData(this.cfg.ServiceUrl, data,
|
|
||||||
function (responseText) {
|
|
||||||
try {
|
|
||||||
var recvData = JSON.parse(responseText);
|
|
||||||
if (recvData && recvData instanceof Object && recvData.IsOK == true) {
|
|
||||||
card.SetNew();
|
|
||||||
} else {
|
|
||||||
card.Reset();
|
|
||||||
}
|
|
||||||
} catch (e) { }
|
|
||||||
}, function () {
|
|
||||||
card.Reset();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
var data = {
|
||||||
|
"IDBoard": this.cfg.IDBoard,
|
||||||
|
"Command": "Move",
|
||||||
|
"IDCard": this.IDCard,
|
||||||
|
"X": this.newX,
|
||||||
|
"Y": this.newY,
|
||||||
|
"TimeStamp": new Date().getTime()
|
||||||
|
};
|
||||||
|
SendData(this.cfg.ServiceUrl, data,
|
||||||
|
function (responseText) {
|
||||||
|
try {
|
||||||
|
var recvData = JSON.parse(responseText);
|
||||||
|
if (recvData && recvData instanceof Object && recvData.IsOK == true) {
|
||||||
|
card.SetNew();
|
||||||
|
} else {
|
||||||
|
card.Reset();
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
|
}, function () {
|
||||||
|
card.Reset();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
OnEdit: function () {
|
OnEdit: function () {
|
||||||
if (this.Title != this.newTitle || this.Body != this.newBody) {
|
if (this.Title != this.newTitle || this.Body != this.newBody) {
|
||||||
|
|||||||
Reference in New Issue
Block a user