[FIX] web: fix Groupby menu style in embedded graph views

This commit is contained in:
Thomas Werland
2019-07-16 07:55:04 +00:00
committed by Mathieu Duckerts-Antoine
parent ba1f4dc381
commit 150bd2b948
2 changed files with 8 additions and 2 deletions
@@ -36,6 +36,7 @@ var GroupByMenuMixin = {
* private
* @param {jQuery} $node
* @param {Object} groupableFields
* @param {Promise}
*/
_addGroupByMenu: function ($node, groupableFields) {
this.sortedFieldNames = _.sortBy(Object.keys(groupableFields), function (fieldName) {
@@ -44,7 +45,7 @@ var GroupByMenuMixin = {
this.groupableFields = groupableFields;
var groupBys = this._getGroupBys(this.model.get().groupBy);
this.groupByMenu = new GroupByMenu(this, groupBys, this.groupableFields);
this.groupByMenu.insertAfter($node.find('div:first'));
return this.groupByMenu.insertAfter($node.find('div:first'));
},
/**
* This method puts the active groupBys in a convenient form.
@@ -96,8 +96,13 @@ var GraphController = AbstractController.extend(GroupByMenuMixin,{
this._updateButtons();
this.$buttons.appendTo($node);
if (this.isEmbedded) {
this._addGroupByMenu($node, this.groupableFields);
this._addGroupByMenu($node, this.groupableFields).then(function(){
var groupByButton = $node.find('.o_dropdown_toggler_btn');
groupByButton.removeClass("o_dropdown_toggler_btn btn btn-secondary dropdown-toggle");
groupByButton.addClass("btn dropdown-toggle btn-outline-secondary");
});
}
}
},