|
@@ -1209,13 +1209,27 @@ class Toolbox extends Component<Props, State> {
|
1209
|
1209
|
const buttonsLeft = [];
|
1210
|
1210
|
const buttonsRight = [];
|
1211
|
1211
|
|
|
1212
|
+ const smallThreshold = 700;
|
|
1213
|
+ const verySmallThreshold = 500;
|
|
1214
|
+
|
|
1215
|
+ let minSpaceBetweenButtons = 48;
|
|
1216
|
+ let widthPlusPaddingOfButton = 56;
|
|
1217
|
+
|
|
1218
|
+ if (this.state.windowWidth <= verySmallThreshold) {
|
|
1219
|
+ minSpaceBetweenButtons = 26;
|
|
1220
|
+ widthPlusPaddingOfButton = 28;
|
|
1221
|
+ } else if (this.state.windowWidth <= smallThreshold) {
|
|
1222
|
+ minSpaceBetweenButtons = 36;
|
|
1223
|
+ widthPlusPaddingOfButton = 40;
|
|
1224
|
+ }
|
|
1225
|
+
|
1212
|
1226
|
const maxNumberOfButtonsPerGroup = Math.floor(
|
1213
|
1227
|
(
|
1214
|
1228
|
this.state.windowWidth
|
1215
|
1229
|
- 168 // the width of the central group by design
|
1216
|
|
- - 48 // the minimum space between the button groups
|
|
1230
|
+ - minSpaceBetweenButtons // the minimum space between the button groups
|
1217
|
1231
|
)
|
1218
|
|
- / 56 // the width + padding of a button
|
|
1232
|
+ / widthPlusPaddingOfButton // the width + padding of a button
|
1219
|
1233
|
/ 2 // divide by the number of groups(left and right group)
|
1220
|
1234
|
);
|
1221
|
1235
|
|
|
@@ -1232,7 +1246,7 @@ class Toolbox extends Component<Props, State> {
|
1232
|
1246
|
if (this._shouldShowButton('closedcaptions')) {
|
1233
|
1247
|
buttonsLeft.push('closedcaptions');
|
1234
|
1248
|
}
|
1235
|
|
- if (overflowHasItems) {
|
|
1249
|
+ if (overflowHasItems && this.state.windowWidth >= verySmallThreshold) {
|
1236
|
1250
|
buttonsRight.push('overflowmenu');
|
1237
|
1251
|
}
|
1238
|
1252
|
if (this._shouldShowButton('invite')) {
|
|
@@ -1255,13 +1269,13 @@ class Toolbox extends Component<Props, State> {
|
1255
|
1269
|
movedButtons.push(...buttonsLeft.splice(
|
1256
|
1270
|
maxNumberOfButtonsPerGroup,
|
1257
|
1271
|
buttonsLeft.length - maxNumberOfButtonsPerGroup));
|
1258
|
|
- if (buttonsRight.indexOf('overflowmenu') === -1) {
|
|
1272
|
+ if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
|
1259
|
1273
|
buttonsRight.unshift('overflowmenu');
|
1260
|
1274
|
}
|
1261
|
1275
|
}
|
1262
|
1276
|
|
1263
|
1277
|
if (buttonsRight.length > maxNumberOfButtonsPerGroup) {
|
1264
|
|
- if (buttonsRight.indexOf('overflowmenu') === -1) {
|
|
1278
|
+ if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
|
1265
|
1279
|
buttonsRight.unshift('overflowmenu');
|
1266
|
1280
|
}
|
1267
|
1281
|
|
|
@@ -1332,7 +1346,7 @@ class Toolbox extends Component<Props, State> {
|
1332
|
1346
|
tooltip = { t('toolbar.invite') } /> }
|
1333
|
1347
|
{ buttonsRight.indexOf('security') !== -1
|
1334
|
1348
|
&& <SecurityDialogButton customClass = 'security-toolbar-button' /> }
|
1335
|
|
- { buttonsRight.indexOf('overflowmenu') !== -1
|
|
1349
|
+ { buttonsRight.indexOf('overflowmenu') !== -1 && this.state.windowWidth >= verySmallThreshold
|
1336
|
1350
|
&& <OverflowMenuButton
|
1337
|
1351
|
isOpen = { _overflowMenuVisible }
|
1338
|
1352
|
onVisibilityChange = { this._onSetOverflowVisible }>
|