Skip to content

Commit 612e932

Browse files
author
Jelte Lagendijk
committed
Fix for MX7.4 conditional visibility
1 parent af62cbc commit 612e932

6 files changed

Lines changed: 8 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ChartJS",
3-
"version": "3.6.0",
3+
"version": "3.6.1",
44
"description": "This widget is a wrapper for the ChartJS library and you can use it to visualize your aggregated data.",
55
"license": "Apache License, Version 2",
66
"author": "Mendix",

src/ChartJS/widgets/Core.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ define([
7575
_addedToBody: false,
7676

7777
_tooltipNode: null,
78+
_destroyed: false,
7879

7980
startup: function () {
8081
logger.debug(this.id + ".startup");
@@ -132,7 +133,7 @@ define([
132133
this._data.datasets.push(set);
133134

134135
this._datasetCounter--;
135-
if (this._datasetCounter === 0) {
136+
if (this._datasetCounter === 0 && !this._destroyed) {
136137
this._processData();
137138
}
138139
},
@@ -258,6 +259,8 @@ define([
258259
uninitialize: function () {
259260
logger.debug(this.id + ".uninitialize");
260261

262+
this._destroyed = true;
263+
261264
//console.log(this._data);
262265
if (this._handle !== null) {
263266
this.unsubscribe(this._handle);

src/ChartJS/widgets/DoughnutChart/widget/DoughnutChart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ define([
104104
this._resize();
105105
}));
106106

107-
if (this.numberInside) {
107+
if (this.numberInside && this._numberNode) {
108108
var content = this._data.object.get(this.numberInside);
109109
html.set(this._numberNode, content !== null ? content.toString() : "");
110110
}

src/ChartJS/widgets/PieChart/widget/PieChart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ define([
106106
};
107107
this._chart = new this._chartJS(this._ctx, chartProperties);
108108

109-
if (this.numberInside) {
109+
if (this.numberInside && this._numberNode) {
110110
var content = this._data.object.get(this.numberInside);
111111
html.set(this._numberNode, content !== null ? content.toString() : "");
112112
}

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="ChartJS" version="3.6.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="ChartJS" version="3.6.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="ChartJS/widgets/BarChart/BarChart.xml"/>
66
<widgetFile path="ChartJS/widgets/LineChart/LineChart.xml"/>

test/widgets/ChartJS.mpk

34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)