Skip to content

Commit 1c48a24

Browse files
author
Jelte Lagendijk
committed
Code cleanup
1 parent b905e16 commit 1c48a24

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

src/formatstring/widget/formatstring.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*jslint white:true, nomen: true, plusplus: true */
2-
/*global mx, define, require, browser, devel, console */
3-
/*mendix */
4-
51
define([
62
"dojo/_base/declare",
73
"mxui/widget/_WidgetBase",
@@ -33,8 +29,6 @@ define([
3329
_timeStrings: {},
3430

3531
postCreate: function () {
36-
// Uncomment next line to start debugging
37-
//logger.level(logger.DEBUG);
3832
logger.debug(this.id + ".postCreate");
3933

4034
this._buildTimeStrings();
@@ -93,7 +87,7 @@ define([
9387

9488
if (!this._contextObj) {
9589
logger.debug(this.id + "._loadData empty context");
96-
mendix.lang.nullExec(callback);
90+
this._executeCallback(callback, "_loadData");
9791
return;
9892
}
9993

@@ -228,7 +222,6 @@ define([
228222
}
229223
},
230224

231-
232225
// _buildString also does _renderString because of callback from fetchReferences is async.
233226
_buildString: function (callback) {
234227
logger.debug(this.id + "._buildString");
@@ -255,10 +248,7 @@ define([
255248
div.innerHTML = msg;
256249
this.domNode.appendChild(div);
257250

258-
if (callback && typeof callback === "function") {
259-
logger.debug(this.id + "._renderString callback");
260-
callback();
261-
}
251+
this._executeCallback(callback, "_renderString");
262252
},
263253

264254
_checkString: function (string, renderAsHTML) {
@@ -381,6 +371,13 @@ define([
381371

382372
}
383373
}
374+
},
375+
376+
_executeCallback: function (cb, from) {
377+
logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
378+
if (cb && typeof cb === "function") {
379+
cb();
380+
}
384381
}
385382
});
386383
});

test/FormatString.mpr

0 Bytes
Binary file not shown.

test/widgets/FormatString.mpk

-52 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)