Where necessary, override remove() to also remove subviews.
This commit is contained in:
@@ -74,6 +74,11 @@ my.Flot = Backbone.View.extend({
|
|||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
remove: function () {
|
||||||
|
this.editor.remove();
|
||||||
|
Backbone.View.prototype.remove.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
// There are issues generating a Flot graph if either:
|
// 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
|
// * 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);
|
$dataSidebar.append(view.view.el);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
var pager = new recline.View.Pager({
|
this.pager = new recline.View.Pager({
|
||||||
model: this.model.queryState
|
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
|
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
|
// hide the sidebar if empty
|
||||||
_showHideSidebar: function() {
|
_showHideSidebar: function() {
|
||||||
var $dataSidebar = this.$el.find('.data-view-sidebar');
|
var $dataSidebar = this.$el.find('.data-view-sidebar');
|
||||||
|
|||||||
Reference in New Issue
Block a user