Merge pull request #219 from fgnass/master

[multiview][xs]: Bugfix for upper right menu in MultiView - thx to @fgnass.
This commit is contained in:
Rufus Pollock 2012-08-23 08:27:57 -07:00
commit 1bc5e72820

View File

@ -111,8 +111,9 @@ my.MultiView = Backbone.View.extend({
</div> \
<div class="menu-right"> \
<div class="btn-group" data-toggle="buttons-checkbox"> \
<a href="#" class="btn active" data-action="filters">Filters</a> \
<a href="#" class="btn active" data-action="fields">Fields</a> \
{{#sidebarViews}} \
<a href="#" data-action="{{id}}" class="btn active">{{label}}</a> \
{{/sidebarViews}} \
</div> \
</div> \
<div class="query-editor-here" style="display:inline;"></div> \
@ -246,6 +247,7 @@ my.MultiView = Backbone.View.extend({
render: function() {
var tmplData = this.model.toTemplateJSON();
tmplData.views = this.pageViews;
tmplData.sidebarViews = this.sidebarViews;
var template = Mustache.render(this.template, tmplData);
$(this.el).html(template);
@ -265,7 +267,7 @@ my.MultiView = Backbone.View.extend({
_.each(this.sidebarViews, function(view) {
this['$'+view.id] = view.view.el;
$dataSidebar.append(view.view.el);
});
}, this);
var pager = new recline.View.Pager({
model: this.model.queryState
@ -308,13 +310,7 @@ my.MultiView = Backbone.View.extend({
_onMenuClick: function(e) {
e.preventDefault();
var action = $(e.target).attr('data-action');
if (action === 'filters') {
this.$filterEditor.toggle();
} else if (action === 'fields') {
this.$fieldsView.toggle();
} else if (action === 'transform') {
this.transformView.el.toggle();
}
this['$'+action].toggle();
},
_onSwitchView: function(e) {