Commit 959af3ad authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

added timeout to pleasewait

parent 7ec9303f
......@@ -6,7 +6,7 @@ var STWkit;
this.StartMilliseconds = 0;
this.ElapsedMilliseconds = 0;
}
PleaseWait.prototype.start = function () {
PleaseWait.prototype.start = function (timeout) {
var self = this;
self.StartMilliseconds = new Date().getTime();
self.wait = true;
......@@ -14,6 +14,12 @@ var STWkit;
if (self.wait)
self.modal = self.pleaseWaitModal();
}, 500);
if (timeout) {
setTimeout(function () {
if (self.wait)
self.modal = self.stop();
}, timeout);
}
};
PleaseWait.prototype.stop = function () {
var self = this;
......
{"version":3,"file":"pleasewait.js","sourceRoot":"","sources":["pleasewait.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAG1C,IAAO,MAAM,CAuCZ;AAvCD,WAAO,MAAM;IACT;QAMI;YACI,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QACjC,CAAC;QACM,0BAAK,GAAZ;YACI,IAAI,IAAI,GAAG,IAAI,CAAC;YAChB,IAAI,CAAC,iBAAiB,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,UAAU,CAAC;gBACP,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;oBAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACvD,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,CAAC;QACM,yBAAI,GAAX;YACI,IAAI,IAAI,GAAG,IAAI,CAAC;YAChB,IAAI,CAAC,mBAAmB,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC;YACzE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBACb,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AU,CAAC;oBACP,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;wBAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC5C,CAAC,EAAE,OAAO,CAAC,CAAC;YAChB,CAAC;QACL,CAAC;QACM,yBAAI,GAAX;YACI,IAAI,IAAI,GAAG,IAAI,CAAC;YAChB,IAAI,CAAC,mBAAmB,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC;YACzE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBACb,IAAI,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAC,qBAAqB;gBACrE,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;oBACf,UAAU,CAAC;wBACP,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;oBACtB,CAAC,EAAE,QAAQ,CAAC,CAAC;gBACjB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBACtB,CAAC;YACL,CAAC;QACL,CAAC;QAEO,oCAAe,GAAvB;YACI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,gGAAgG,CAAC,CAAC;QACjI,CAAC;QACL,iBAAC;IAAD,CAAC,AA1CD,IA0CC;IA1CY,iBAAU,aA0CtB,CAAA;AACL,CAAC,EA5CM,MAAM,KAAN,MAAM,QA4CZ"}
\ No newline at end of file
......@@ -12,13 +12,18 @@ module STWkit {
this.StartMilliseconds = 0;
this.ElapsedMilliseconds = 0;
}
public start() {
public start(timeout) {
var self = this;
self.StartMilliseconds = new Date().getTime();
self.wait = true;
setTimeout(function () {
if (self.wait) self.modal = self.pleaseWaitModal();
}, 500);
if (timeout) {
setTimeout(function () {
if (self.wait) self.modal = self.stop();
}, timeout);
}
}
public stop() {
var self = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment