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