Skip to content

Commit ecfe951

Browse files
committed
Fix on visibility handling with Mx 7.1
1 parent 7dbb14b commit ecfe951

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/DataviewLoader/DataviewLoader.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
<category>Behavior</category>
3434
<description>When the content has been loaded, must there be a fade in executed?</description>
3535
</property>
36+
<property key="visibilityCheck" type="boolean" defaultValue="false">
37+
<caption>Visibility handling</caption>
38+
<category>Behavior</category>
39+
<description>Is the widget placed in conditional visibility part (example: Tabpage)? This check will prevent for loading the content before the widget is visible.</description>
40+
</property>
3641
<property key="loadingMF" type="microflow" required="false">
3742
<caption>Microflow</caption>
3843
<category>Datasource</category>

src/DataviewLoader/widget/DataviewLoader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ define([
9393
resize: function (box) {
9494
console.log(this.id + ".resize");
9595
// TODO: How to handle tabs and conditional visibility
96-
if (this.domNode.offsetParent !== null) {
96+
if (this.domNode.offsetParent !== null && this.visibilityCheck) {
9797
this._loadAndShowcontent();
9898
}
9999
},
@@ -134,7 +134,7 @@ define([
134134
// The callback, coming from update, needs to be executed, to let the page know it finished rendering
135135
this._executeCallback(callback, "_updateRendering");
136136

137-
if (this.domNode.offsetParent !== null) {
137+
if (this.domNode.offsetParent !== null && this.visibilityCheck) {
138138
this._loadAndShowcontent();
139139
}
140140
},
@@ -227,7 +227,7 @@ define([
227227
this.unsubscribeAll();
228228

229229
// When a mendix object exists create subscribtions.
230-
if (this._contextObj && this.refreshAction == "Object" || this.refreshAction == "Attribute") {
230+
if (this._contextObj && (this.refreshAction === "Object" || this.refreshAction === "Attribute")) {
231231
console.log(this.id + "._resetSubscriptions setup refresh handler: " + this.refreshAction);
232232
this.subscribe({
233233
guid: this._contextObj.getGuid(),

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="DataviewLoader" version="1.5.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="DataviewLoader" version="1.6.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="DataviewLoader/DataviewLoader.xml" />
66
</widgetFiles>

test/widgets/DataviewLoader.mpk

121 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)