Skip to content

Instantly share code, notes, and snippets.

@induprasad
Last active April 25, 2018 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save induprasad/13802df0ead0f1b147a03ad18fc1617f to your computer and use it in GitHub Desktop.
Save induprasad/13802df0ead0f1b147a03ad18fc1617f to your computer and use it in GitHub Desktop.
Controller of the LCMP_Strike component
({
//Function called on Init
onInit: function (component, event, helper) {
var data = component.get("v.data");
component.set('v.scriptsLoaded', true);
component.set('v.triggerRedraw', !component.get('v.triggerRedraw'));
component.resize = $A.getCallback(function () {
if (component.isValid()) {
component.set('v.fontSize', helper.determineFontSize(component.get('v.containerWidth')));
component.set('v.chartRendered', false);
component.set('v.triggerRedraw', !component.get('v.triggerRedraw'));
} else {
window.removeEventListener('resize', component.resize);
}
});
window.addEventListener('resize', component.resize, true);
},
//Function which sets the spinner to false after chart is loaded
reRenderCharts: function (component, event, helper) {
component.set('v.chartRendered', false);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment