+30
-20
lines changedFilter options
+30
-20
lines changed Original file line number Diff line number Diff line change
@@ -80,8 +80,9 @@ const hiddenSettingsDefault = {
80
80
modifyWebextFlavor: 'unset',
81
81
popupFontSize: 'unset',
82
82
popupPanelDisabledSections: 0,
83
-
popupPanelLockedSections: 0,
84
83
popupPanelHeightMode: 0,
84
+
popupPanelLockedSections: 0,
85
+
popupPanelOrientation: 'unset',
85
86
requestJournalProcessPeriod: 1000,
86
87
requestStatsDisabled: false,
87
88
selfieDelayInSeconds: 53,
Original file line number Diff line number Diff line change
@@ -378,6 +378,7 @@ const popupDataFromTabId = function(tabId, tabTitle) {
378
378
popupPanelDisabledSections: µbhs.popupPanelDisabledSections,
379
379
popupPanelLockedSections: µbhs.popupPanelLockedSections,
380
380
popupPanelHeightMode: µbhs.popupPanelHeightMode,
381
+
popupPanelOrientation: µbhs.popupPanelOrientation,
381
382
tabId,
382
383
tabTitle,
383
384
tooltipsDisabled: µbus.tooltipsDisabled,
Original file line number Diff line number Diff line change
@@ -802,7 +802,7 @@ let renderOnce = function() {
802
802
dom.attr('#firewall [title][data-src]', 'title', null);
803
803
}
804
804
805
-
// This must be done the firewall is populated
805
+
// This must be done when the firewall is populated
806
806
if ( popupData.popupPanelHeightMode === 1 ) {
807
807
dom.cl.add(dom.body, 'vMin');
808
808
}
@@ -1462,6 +1462,31 @@ const getPopupData = async function(tabId, first = false) {
1462
1462
}
1463
1463
};
1464
1464
1465
+
const setOrientation = async ( ) => {
1466
+
if ( dom.cl.has(dom.root, 'mobile') ) {
1467
+
dom.cl.remove(dom.root, 'desktop');
1468
+
dom.cl.add(dom.root, 'portrait');
1469
+
return;
1470
+
}
1471
+
if ( selfURL.searchParams.get('portrait') !== null ) {
1472
+
dom.cl.add(dom.root, 'portrait');
1473
+
return;
1474
+
}
1475
+
if ( popupData.popupPanelOrientation === 'landscape' ) { return; }
1476
+
if ( popupData.popupPanelOrientation === 'portrait' ) {
1477
+
dom.cl.add(dom.root, 'portrait');
1478
+
return;
1479
+
}
1480
+
if ( dom.cl.has(dom.root, 'desktop') === false ) { return; }
1481
+
await nextFrames(8);
1482
+
const main = qs$('#main');
1483
+
const firewall = qs$('#firewall');
1484
+
const minWidth = (main.offsetWidth + firewall.offsetWidth) / 1.1;
1485
+
if ( window.innerWidth < minWidth ) {
1486
+
dom.cl.add(dom.root, 'portrait');
1487
+
}
1488
+
};
1489
+
1465
1490
// The purpose of the following code is to reset to a vertical layout
1466
1491
// should the viewport not be enough wide to accommodate the horizontal
1467
1492
// layout.
@@ -1474,24 +1499,7 @@ const getPopupData = async function(tabId, first = false) {
1474
1499
// Use a tolerance proportional to the sum of the width of the panes
1475
1500
// when testing against viewport width.
1476
1501
const checkViewport = async function() {
1477
-
if (
1478
-
dom.cl.has(dom.root, 'mobile') ||
1479
-
selfURL.searchParams.get('portrait')
1480
-
) {
1481
-
dom.cl.add(dom.root, 'portrait');
1482
-
dom.cl.remove(dom.root, 'desktop');
1483
-
} else if ( dom.cl.has(dom.root, 'desktop') ) {
1484
-
await nextFrames(8);
1485
-
const main = qs$('#main');
1486
-
const firewall = qs$('#firewall');
1487
-
const minWidth = (main.offsetWidth + firewall.offsetWidth) / 1.1;
1488
-
if (
1489
-
selfURL.searchParams.get('portrait') ||
1490
-
window.innerWidth < minWidth
1491
-
) {
1492
-
dom.cl.add(dom.root, 'portrait');
1493
-
}
1494
-
}
1502
+
await setOrientation();
1495
1503
if ( dom.cl.has(dom.root, 'portrait') ) {
1496
1504
const panes = qs$('#panes');
1497
1505
const sticky = qs$('#sticky');
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4