Cleanup redrawing triggering, remove unused message handlers

This commit is contained in:
guerler
2018-02-11 14:42:13 -05:00
parent bd9167400e
commit 0b30336c21
2 changed files with 3 additions and 15 deletions
@@ -93,24 +93,13 @@ export default Backbone.View.extend({
self.chart.groups.add({ id: Utils.uid() });
}
});
this.message = new Ui.Message({
message: "There are no data selection options for this visualization type.",
persistent: true,
status: "info"
});
this.setElement(
$("<div/>")
.append(this.repeat.$el.addClass("ui-margin-bottom"))
.append(this.message.$el.addClass("ui-margin-bottom"))
.append(this.repeat.$el)
);
this.listenTo(this.chart, "change", function() {
self.render();
});
this.listenTo(this.chart.groups, "remove reset", function() {
self.chart.trigger("redraw")
});
this.listenTo(this.chart.groups, "remove", function(group) {
self.repeat.del(group.id);
self.chart.trigger("redraw");
});
this.listenTo(this.chart.groups, "reset", function() {
self.repeat.delAll();
@@ -129,10 +118,8 @@ export default Backbone.View.extend({
render: function() {
if (_.size(this.chart.plugin.groups) > 0) {
this.repeat.$el.show();
this.message.$el.hide();
} else {
this.repeat.$el.hide();
this.message.$el.show();
}
}
});
@@ -27,6 +27,7 @@ export default Backbone.View.extend({
this._createContainer("div");
this.chart.on("redraw", function() {
self.app.deferred.execute(function(process) {
console.debug("viewer:redraw() - Redrawing...");
self._draw(process, self.chart);
});
});