global clear works on plots

This commit is contained in:
Deep Tailor
2019-06-06 15:06:03 -07:00
parent fd749253d9
commit 84bfb9e8cc
2 changed files with 25 additions and 0 deletions

View File

@@ -377,6 +377,19 @@ define([
delete this.unsubscribe;
}
this.fetch();
},
/**
* Clears the plot series, unsubscribes and resubscribes
* @public
*/
refresh: function () {
this.reset();
if (this.unsubscribe) {
this.unsubscribe();
delete this.unsubscribe;
}
this.fetch();
}
});

View File

@@ -80,6 +80,10 @@ define([
'configuration.filters',
this.updateFiltersAndResubscribe.bind(this)
);
this.refresh = this.refresh.bind(this);
this.openmct.notifications.on('clear', this.refresh);
}
eventHelpers.extend(PlotController.prototype);
@@ -166,6 +170,8 @@ define([
if (this.filterObserver) {
this.filterObserver();
}
this.openmct.notifications.off('clear', this.refresh);
};
PlotController.prototype.loadMoreData = function (range, purge) {
@@ -263,6 +269,12 @@ define([
});
};
PlotController.prototype.refresh = function (updatedFilters) {
this.config.series.forEach(function (series) {
series.refresh();
});
};
/**
* Export view as JPG.
*/