Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14647723
D15135.id36543.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
959 B
Referenced Files
None
Subscribers
None
D15135.id36543.diff
View Options
diff --git a/webroot/rsrc/js/core/behavior-device.js b/webroot/rsrc/js/core/behavior-device.js
--- a/webroot/rsrc/js/core/behavior-device.js
+++ b/webroot/rsrc/js/core/behavior-device.js
@@ -26,6 +26,19 @@
var v = JX.Vector.getViewport();
var self = JX.Device;
+ // Even when we emit a '<meta name="viewport" ... />' tag which tells
+ // devices to fit the conent to the screen width, we'll sometimes measure
+ // a viewport dimension which is larger than the available screen width,
+ // particularly if we check too early.
+
+ // If the device provides a screen width and the screen width is smaller
+ // than the viewport width, use the screen width.
+
+ var screen_width = (window.screen && window.screen.availWidth);
+ if (screen_width) {
+ v.x = Math.min(v.x, screen_width);
+ }
+
var device = 'desktop';
if (v.x <= self._tabletBreakpoint) {
device = 'tablet';
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 1:28 PM (19 h, 43 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6987104
Default Alt Text
D15135.id36543.diff (959 B)
Attached To
Mode
D15135: Improve reliability of detecting small devices when loading Differential changesets
Attached
Detach File
Event Timeline
Log In to Comment