Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments to loading of pane widgets #661

Merged
merged 3 commits into from
Jan 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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