Where necessary, override remove() to also remove subviews.
This commit is contained in:
parent
5ef821c92a
commit
93637a7b0b
@ -74,6 +74,11 @@ my.Flot = Backbone.View.extend({
|
||||
return this;
|
||||
},
|
||||
|
||||
remove: function () {
|
||||
this.editor.remove();
|
||||
Backbone.View.prototype.remove.apply(this, arguments);
|
||||
},
|
||||
|
||||
redraw: function() {
|
||||
// There are issues generating a Flot graph if either:
|
||||
// * The relevant div that graph attaches to his hidden at the moment of creating the plot -- Flot will complain with
|
||||
|
||||
@ -263,18 +263,30 @@ my.MultiView = Backbone.View.extend({
|
||||
$dataSidebar.append(view.view.el);
|
||||
}, this);
|
||||
|
||||
var pager = new recline.View.Pager({
|
||||
this.pager = new recline.View.Pager({
|
||||
model: this.model.queryState
|
||||
});
|
||||
this.$el.find('.recline-results-info').after(pager.el);
|
||||
this.$el.find('.recline-results-info').after(this.pager.el);
|
||||
|
||||
var queryEditor = new recline.View.QueryEditor({
|
||||
this.queryEditor = new recline.View.QueryEditor({
|
||||
model: this.model.queryState
|
||||
});
|
||||
this.$el.find('.query-editor-here').append(queryEditor.el);
|
||||
this.$el.find('.query-editor-here').append(this.queryEditor.el);
|
||||
|
||||
},
|
||||
|
||||
remove: function () {
|
||||
_.each(this.pageViews, function (view) {
|
||||
view.view.remove();
|
||||
});
|
||||
_.each(this.sidebarViews, function (view) {
|
||||
view.view.remove();
|
||||
});
|
||||
this.pager.remove();
|
||||
this.queryEditor.remove();
|
||||
Backbone.View.prototype.remove.apply(this, arguments);
|
||||
},
|
||||
|
||||
// hide the sidebar if empty
|
||||
_showHideSidebar: function() {
|
||||
var $dataSidebar = this.$el.find('.data-view-sidebar');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user