Skip to content

Commit 373cb1f

Browse files
Merge branch 'master-local' into master-dist
2 parents ad97484 + 3a20d35 commit 373cb1f

File tree

57 files changed

+171
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+171
-139
lines changed

dist/angular-patternfly.js

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4662,10 +4662,30 @@ angular.module('patternfly.charts').component('pfHeatmap', {
46624662
});
46634663
};
46644664

4665-
ctrl.updateAll = function () {
4666-
// Need to deep watch changes in chart data
4665+
var updateDisplay = function () {
4666+
setStyles();
4667+
4668+
if (ctrl.chartDataAvailable !== false && ctrl.data) {
4669+
ctrl.loadingDone = true;
4670+
4671+
// Allow the style change to take effect to update the container size
4672+
$timeout(function () {
4673+
setSizes();
4674+
redraw();
4675+
});
4676+
}
4677+
};
4678+
4679+
var handleDataUpdate = function () {
46674680
prevData = angular.copy(ctrl.data);
4681+
updateDisplay();
4682+
};
4683+
4684+
var debounceResize = _.debounce(function () {
4685+
updateDisplay();
4686+
}, 250, 500);
46684687

4688+
var updateConfig = function () {
46694689
//Allow overriding of defaults
46704690
if (ctrl.maxBlockSize === undefined || isNaN(ctrl.maxBlockSize)) {
46714691
ctrl.maxSize = 64;
@@ -4715,46 +4735,36 @@ angular.module('patternfly.charts').component('pfHeatmap', {
47154735
}
47164736
ctrl.height = ctrl.height || heightDefault;
47174737
ctrl.showLegend = ctrl.showLegend || (ctrl.showLegend === undefined);
4718-
ctrl.loadingDone = false;
4719-
4720-
angular.element($window).on('resize', function () {
4721-
setSizes();
4722-
redraw();
4723-
});
4724-
4725-
ctrl.thisComponent = $element[0].querySelector('.heatmap-pf-svg');
4726-
4727-
$timeout(function () {
4728-
setStyles();
4729-
setSizes();
4730-
redraw();
4731-
});
47324738
};
47334739

4740+
ctrl.loadingDone = false;
4741+
47344742
ctrl.$onChanges = function (changesObj) {
47354743
if (changesObj.chartDataAvailable && !changesObj.chartDataAvailable.isFirstChange()) {
47364744
setStyles();
4737-
} else {
4738-
ctrl.updateAll();
4739-
ctrl.loadingDone = true;
4745+
} else if (!changesObj.data) {
4746+
updateConfig();
4747+
updateDisplay();
47404748
}
47414749
};
47424750

47434751
ctrl.$doCheck = function () {
47444752
// do a deep compare on chartData and config
47454753
if (!angular.equals(ctrl.data, prevData)) {
4746-
setStyles();
4747-
if (ctrl.chartDataAvailable !== false) {
4748-
setSizes();
4749-
redraw();
4750-
}
4754+
handleDataUpdate();
47514755
}
47524756
};
47534757

47544758
ctrl.$postLink = function () {
4755-
setStyles();
4756-
setSizes();
4757-
redraw();
4759+
ctrl.thisComponent = $element[0].querySelector('.heatmap-pf-svg');
4760+
updateConfig();
4761+
handleDataUpdate();
4762+
4763+
angular.element($window).on('resize', debounceResize);
4764+
};
4765+
4766+
ctrl.$onDestroy = function () {
4767+
angular.element($window).off('resize', debounceResize);
47584768
};
47594769
}]
47604770
});

dist/angular-patternfly.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/docs/grunt-scripts/angular-patternfly.js

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4662,10 +4662,30 @@ angular.module('patternfly.charts').component('pfHeatmap', {
46624662
});
46634663
};
46644664

4665-
ctrl.updateAll = function () {
4666-
// Need to deep watch changes in chart data
4665+
var updateDisplay = function () {
4666+
setStyles();
4667+
4668+
if (ctrl.chartDataAvailable !== false && ctrl.data) {
4669+
ctrl.loadingDone = true;
4670+
4671+
// Allow the style change to take effect to update the container size
4672+
$timeout(function () {
4673+
setSizes();
4674+
redraw();
4675+
});
4676+
}
4677+
};
4678+
4679+
var handleDataUpdate = function () {
46674680
prevData = angular.copy(ctrl.data);
4681+
updateDisplay();
4682+
};
4683+
4684+
var debounceResize = _.debounce(function () {
4685+
updateDisplay();
4686+
}, 250, 500);
46684687

4688+
var updateConfig = function () {
46694689
//Allow overriding of defaults
46704690
if (ctrl.maxBlockSize === undefined || isNaN(ctrl.maxBlockSize)) {
46714691
ctrl.maxSize = 64;
@@ -4715,46 +4735,36 @@ angular.module('patternfly.charts').component('pfHeatmap', {
47154735
}
47164736
ctrl.height = ctrl.height || heightDefault;
47174737
ctrl.showLegend = ctrl.showLegend || (ctrl.showLegend === undefined);
4718-
ctrl.loadingDone = false;
4719-
4720-
angular.element($window).on('resize', function () {
4721-
setSizes();
4722-
redraw();
4723-
});
4724-
4725-
ctrl.thisComponent = $element[0].querySelector('.heatmap-pf-svg');
4726-
4727-
$timeout(function () {
4728-
setStyles();
4729-
setSizes();
4730-
redraw();
4731-
});
47324738
};
47334739

4740+
ctrl.loadingDone = false;
4741+
47344742
ctrl.$onChanges = function (changesObj) {
47354743
if (changesObj.chartDataAvailable && !changesObj.chartDataAvailable.isFirstChange()) {
47364744
setStyles();
4737-
} else {
4738-
ctrl.updateAll();
4739-
ctrl.loadingDone = true;
4745+
} else if (!changesObj.data) {
4746+
updateConfig();
4747+
updateDisplay();
47404748
}
47414749
};
47424750

47434751
ctrl.$doCheck = function () {
47444752
// do a deep compare on chartData and config
47454753
if (!angular.equals(ctrl.data, prevData)) {
4746-
setStyles();
4747-
if (ctrl.chartDataAvailable !== false) {
4748-
setSizes();
4749-
redraw();
4750-
}
4754+
handleDataUpdate();
47514755
}
47524756
};
47534757

47544758
ctrl.$postLink = function () {
4755-
setStyles();
4756-
setSizes();
4757-
redraw();
4759+
ctrl.thisComponent = $element[0].querySelector('.heatmap-pf-svg');
4760+
updateConfig();
4761+
handleDataUpdate();
4762+
4763+
angular.element($window).on('resize', debounceResize);
4764+
};
4765+
4766+
ctrl.$onDestroy = function () {
4767+
angular.element($window).off('resize', debounceResize);
47584768
};
47594769
}]
47604770
});

dist/docs/partials/api/patternfly.autofocus.pfFocused.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/autofocus/autofocus.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/autofocus/autofocus.js#L39" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfFocused</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/autofocus/autofocus.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/autofocus/autofocus.js#L39" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfFocused</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.canvas.directive.pfCanvas.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/canvas-view/examples/canvas.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/canvas-view/examples/canvas.js#L329" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCanvas</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/canvas-view/examples/canvas.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/canvas-view/examples/canvas.js#L329" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCanvas</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.canvas</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.canvas.directive.pfCanvasEditor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/canvas-view/examples/canvasEditor.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/canvas-view/examples/canvasEditor.js#L344" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCanvasEditor</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/canvas-view/examples/canvasEditor.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/canvas-view/examples/canvasEditor.js#L344" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCanvasEditor</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.canvas</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfAggregateStatusCard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/aggregate-status/aggregate-status-card.component.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/card/aggregate-status/aggregate-status-card.component.js#L132" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfAggregateStatusCard</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/aggregate-status/aggregate-status-card.component.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/card/aggregate-status/aggregate-status-card.component.js#L132" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfAggregateStatusCard</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfCard - Timeframe Filters.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-timeframe.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/card/examples/card-timeframe.js#L82" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Timeframe Filters</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-timeframe.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/card/examples/card-timeframe.js#L82" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Timeframe Filters</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfCard - Trends.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-trend.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/card/examples/card-trend.js#L146" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Trends</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-trend.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/card/examples/card-trend.js#L146" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Trends</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfCard - Utilization.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/basic/card.component.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/df85d3f/src/card/basic/card.component.js#L86" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Utilization</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/basic/card.component.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/ca93ea3/src/card/basic/card.component.js#L86" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Utilization</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

0 commit comments

Comments
 (0)