Cards: Properties from timming configurability.

This commit is contained in:
2015-06-24 14:34:22 +02:00
parent 1261ecb39e
commit 886079b1c5
2 changed files with 20 additions and 6 deletions

View File

@@ -20,6 +20,10 @@ namespace Scrummer.Controls
private int _timePoolData = 10000;
private int _timeRefresh = 20;
private int _timeRefreshDisconnected = 5000;
#endregion
#region Properties
@@ -48,6 +52,18 @@ namespace Scrummer.Controls
set { _timePoolData = value; }
}
public int TimeRefresh
{
get { return _timeRefresh; }
set { _timeRefresh = value; }
}
public int TimeRefreshDisconnected
{
get { return _timeRefreshDisconnected; }
set { _timeRefreshDisconnected = value; }
}
#endregion
#region Control Life cycle
@@ -82,6 +98,8 @@ namespace Scrummer.Controls
sbCfg.AppendFormat(" IDCardEvent: \"\",\n");
sbCfg.AppendFormat(" ServiceUrl: \"{0}\",\n", _serviceUrl);
sbCfg.AppendFormat(" TimePoolData: {0},\n", _timePoolData);
sbCfg.AppendFormat(" TimeRefresh: {0},\n", _timeRefresh);
sbCfg.AppendFormat(" TimeRefreshDisconnected: {0},\n", _timeRefreshDisconnected);
sbCfg.AppendFormat(" Texts: {{\n");
sbCfg.AppendFormat(" Toolbox: \"Toolbox\",\n");
sbCfg.AppendFormat(" AddCard: \"+ Add card\",\n");

View File

@@ -106,8 +106,6 @@ Toolbox.prototype = {
pos.x += this.divToolbox.offsetLeft;
pos.y += this.divToolbox.offsetTop + this.divToolbox.offsetHeight;
var card = new Card(this.cfg, 0, "", "", pos.x, pos.y);
//card.SetDeleteCallback(bindedCardDelete);
//cfg.Cards.push(card);
card.InsertInContainer(this.cfg.divBoard);
card.EnterEditionMode();
return false;
@@ -596,7 +594,7 @@ function RunCardBoard(cfg) {
// Reset pool
window.setTimeout(function () {
RequestCardEventData();
}, 20);
}, cfg.TimeRefresh);
};
var ErrorCardEventData = function () {
cfg.Connected = false;
@@ -604,7 +602,7 @@ function RunCardBoard(cfg) {
// Retry
window.setTimeout(function () {
RequestCardEventData();
}, 5000);
}, cfg.TimeRefreshDisconnected);
};
// Pool data
@@ -618,5 +616,3 @@ function RunCardBoard(cfg) {
};
RequestCardEventData();
}