Skip to content

Commit

Permalink
Merge pull request #661 from cmv/fix/adjustments-to-loading-pane-widgets
Browse files Browse the repository at this point in the history
Adjustments to loading of pane widgets
  • Loading branch information
DavidSpriggs authored Jan 10, 2017
2 parents 3d20129 + 202596d commit 48936ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion viewer/js/viewer/_WidgetsMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ define([
widget.widgetKey = widget.widgetKey || widget.id || key;
if (widget.include && (!this.widgets[widget.widgetKey]) && (array.indexOf(widgetTypes, widget.type) >= 0)) {
widget.position = (typeof (widget.position) !== 'undefined') ? widget.position : 10000;
if ((widget.type === 'titlePane' || widget.type === 'contentPane') && !widget.placeAt) {
widget.placeAt = 'left';
}
widgets.push(widget);
this.widgets[key] = true; // will be replaced by actual widget once created
}
Expand All @@ -60,11 +63,14 @@ define([
}

for (var pane in this.panes) {
if (this.panes.hasOwnProperty(pane) && (pane !== 'outer' || pane !== 'center')) {
if (this.panes.hasOwnProperty(pane) && pane !== 'outer' && pane !== 'center') {
paneWidgets = getPaneWidgets(pane);
paneWidgets.sort(function (a, b) {
return a.position - b.position;
});
if (paneWidgets.length > 0 && paneWidgets[0].position !== 0) {
paneWidgets[0].position = 0;
}
array.forEach(paneWidgets, function (paneWidget, i) {
this.widgetLoader(paneWidget, i);
}, this);
Expand Down

0 comments on commit 48936ae

Please sign in to comment.