Skip to content

Commit bebcc6b

Browse files
Fix #11304 Improve the layout of the timeline plugin by putting widgets tray in footer (#11844) (#11850)
(cherry picked from commit f9a698e) Co-authored-by: Sovas Tiwari <40485930+subashtiwari1010@users.noreply.github.com>
1 parent b928135 commit bebcc6b

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

web/client/plugins/MousePosition.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default {
146146
MousePositionPlugin: Object.assign(MousePositionPlugin, {
147147
MapFooter: {
148148
name: 'mousePosition',
149-
position: 2,
149+
position: 3,
150150
target: 'right-footer',
151151
priority: 1
152152
}

web/client/plugins/ScaleBox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default {
6060
}, {
6161
MapFooter: {
6262
name: 'scale',
63-
position: 1,
63+
position: 2,
6464
target: 'right-footer',
6565
priority: 1
6666
}

web/client/plugins/WidgetsTray.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import WidgetsTray from './widgets/WidgetsTray';
1111
import autoDisableWidgets from './widgets/autoDisableWidgets';
1212
import epics from '../epics/widgetsTray';
13+
import { createPlugin } from '../utils/PluginsUtils';
1314

1415
/**
1516
* Plugin that allow to collapse widgets. Shows a small tray where to see the collapsed plugins list.
@@ -18,7 +19,15 @@ import epics from '../epics/widgetsTray';
1819
* @prop {boolean|string|array} [toolsOptions.seeHidden] hides the widgets under particular conditions. **Must** be the same of rule of the Widget plugin. @see plugins.Widgets.
1920
* @class
2021
*/
21-
export default {
22-
WidgetsTrayPlugin: autoDisableWidgets(WidgetsTray),
22+
export default createPlugin("WidgetsTrayPlugin", {
23+
component: autoDisableWidgets(WidgetsTray),
24+
containers: {
25+
MapFooter: {
26+
name: 'widgetsTray',
27+
position: 1,
28+
target: 'right-footer',
29+
priority: 1
30+
}
31+
},
2332
epics
24-
};
33+
});

web/client/plugins/widgets/WidgetsTray.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ class WidgetsTray extends React.Component {
9696
render() {
9797
return this.props.enabled
9898
? (<div className="widgets-tray"
99-
style={{
100-
marginBottom: this.props.isMobileAgent && !this.props.is3DMap ? 60 : 2,
99+
style={this.props.isMobileAgent ? {
100+
marginBottom: !this.props.is3DMap ? 60 : 2,
101101
marginRight: (this.props.layout?.right ?? 0) + 65,
102102
bottom: 0,
103103
right: 0,
104-
position: "absolute"
105-
}}>
104+
position: "absolute",
105+
zIndex: 1000
106+
} : {}}>
106107
<BorderLayout
108+
style={{ width: 'auto' }}
107109
columns={[
108110
...( !this.props.isSingleWidgetLayout
109111
? [<CollapseTrayButton key="collapse-tray" toolsOptions={this.props.toolsOptions} expanded={this.props.expanded} onClick={() => this.props.setExpanded(!this.props.expanded)} />]
@@ -137,9 +139,9 @@ export default compose(
137139
hasCollapsedWidgets: widgets.filter(({ collapsed } = {}) => collapsed).length > 0,
138140
hasTrayWidgets: widgets.length > 0
139141
})),
140-
withProps(({ isMobileAgent, width, singleWidgetLayoutBreakpoint = 1024 }) => {
142+
withProps(({ isMobileAgent }) => {
141143
return {
142-
isSingleWidgetLayout: isMobileAgent || width <= singleWidgetLayoutBreakpoint
144+
isSingleWidgetLayout: isMobileAgent
143145
};
144146
}),
145147
// flag of plugin presence

web/client/themes/default/less/widget.less

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,7 @@
478478
}
479479

480480
.widgets-tray {
481-
.shadow-soft;
482481
padding: 4px;
483-
z-index: 1000;
484482
.widgets-bar {
485483
> span {
486484
button.btn {
@@ -493,6 +491,10 @@
493491
border-right: 1px solid @ms-main-border-color;
494492
}
495493
}
494+
.ms2-border-layout-body,
495+
.ms2-border-layout-content {
496+
flex: none !important;
497+
}
496498
}
497499

498500
.mapstore-chart-advance-options {

0 commit comments

Comments
 (0)