Skip to content

Commit

Permalink
Merge pull request #535 from cmv/fix/pane-object-in-config
Browse files Browse the repository at this point in the history
including panes config in viewer.js breaks application.
  • Loading branch information
DavidSpriggs committed Apr 11, 2016
2 parents 0322700 + e83f4e9 commit e7ac203
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions viewer/js/viewer/_LayoutMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ define([
addTopics: function () {
// toggle a sidebar pane
topic.subscribe('viewer/togglePane', lang.hitch(this, function (args) {
this.toggleSidebar(args.pane, args.show);
this.togglePane(args.pane, args.show);
}));

// load a widget
Expand Down Expand Up @@ -160,12 +160,17 @@ define([
}
}
this.panes.outer.startup();
this.createPanes(panes);
},

createPanes: function (panes) {
var key;
// where to place the buttons
createPanes: function () {
var key,
panes = this.config.panes || {};
for (key in this.panes) {
if (this.panes.hasOwnProperty(key)) {
panes[key] = lang.mixin(this.panes[key], panes[key]);
}
}
// where to place the buttons
// either the center map pane or the outer pane?
this.collapseButtonsPane = this.config.collapseButtonsPane || 'outer';

Expand Down Expand Up @@ -204,6 +209,7 @@ define([
}
}

this.resizeLayout();
},

togglePane: function (id, show) {
Expand Down
2 changes: 1 addition & 1 deletion viewer/js/viewer/_MapMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ define([
});

// in _LayoutsMixin
this.resizeLayout();
this.createPanes();

// in _WidgetsMixin
this.initWidgets();
Expand Down

0 comments on commit e7ac203

Please sign in to comment.