Skip to content

Commit

Permalink
- Fix for incorrect parent button selection
Browse files Browse the repository at this point in the history
  • Loading branch information
WRidder committed May 4, 2015
1 parent ccba96d commit d2fc5c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backgrid-columnmanager",
"version": "0.2.0",
"version": "0.2.1",
"homepage": "https:/WRidder/Backgrid.ColumnManager",
"authors": [
"Wilbert van de Ridder <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backgrid-columnmanager",
"version": "0.2.0",
"version": "0.2.1",
"description": "A backgrid column manager. Adds the ability to show/hide columns.",
"main": "lib/Backgrid.ColumnManager.js",
"scripts": {
Expand Down
10 changes: 7 additions & 3 deletions src/Backgrid.ColumnManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ var DropDownView = Backbone.View.extend({
this.options = opts;
this.columnManager = opts.columnManager;
this.ItemView = (opts.DropdownItemView instanceof Backbone.View) ? opts.DropdownItemView : DropDownItemView;
this.button = opts.button;
this.$dropdownButton = opts.$dropdownButton;

this.on("dropdown:opened", this.open, this);
this.on("dropdown:closed", this.close, this);
Expand Down Expand Up @@ -594,7 +594,7 @@ var DropDownView = Backbone.View.extend({
this.$el.addClass("open");

// Get button
var $button = this.$el.parent().find(".dropdown-button").first();
var $button = this.$dropdownButton;

// Align
var align;
Expand Down Expand Up @@ -749,11 +749,15 @@ Backgrid.Extension.ColumnManagerVisibilityControl = Backbone.View.extend({
this.$el.width(this.options.width + "px");
}

// Create button element
this.$dropdownButton = $(this.options.buttonTemplate());

var viewOptions = {
columnManager: this.columnManager,
DropdownItemView: this.options.DropdownItemView,
dropdownItemTemplate: this.options.dropdownItemTemplate,
align: this.options.dropdownAlign
align: this.options.dropdownAlign,
$dropdownButton: this.$dropdownButton
};

// Check if a different childView has been provided, if not, use default dropdown view
Expand Down

0 comments on commit d2fc5c5

Please sign in to comment.