Page MenuHomePhabricator

D15135.id36540.diff
No OneTemporary

D15135.id36540.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => '8abb1666',
- 'core.pkg.js' => '573e6664',
+ 'core.pkg.js' => '6242889d',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
'differential.pkg.js' => 'f83532f8',
@@ -465,7 +465,7 @@
'rsrc/js/core/behavior-choose-control.js' => '327a00d1',
'rsrc/js/core/behavior-crop.js' => 'fa0f4fc2',
'rsrc/js/core/behavior-dark-console.js' => 'f411b6ae',
- 'rsrc/js/core/behavior-device.js' => 'a205cf28',
+ 'rsrc/js/core/behavior-device.js' => 'bc0d23ab',
'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '4f6a4b4e',
'rsrc/js/core/behavior-error-log.js' => '6882e80a',
'rsrc/js/core/behavior-fancy-datepicker.js' => '8ae55229',
@@ -584,7 +584,7 @@
'javelin-behavior-dashboard-tab-panel' => 'd4eecc63',
'javelin-behavior-day-view' => '5c46cff2',
'javelin-behavior-desktop-notifications-control' => 'edd1ba66',
- 'javelin-behavior-device' => 'a205cf28',
+ 'javelin-behavior-device' => 'bc0d23ab',
'javelin-behavior-differential-add-reviewers-and-ccs' => 'e10f8e18',
'javelin-behavior-differential-comment-jump' => '4fdb476d',
'javelin-behavior-differential-diff-radios' => 'e1ff79b1',
@@ -1602,13 +1602,6 @@
'javelin-vector',
'javelin-magical-init',
),
- 'a205cf28' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-dom',
- 'javelin-vector',
- 'javelin-install',
- ),
'a2828756' => array(
'javelin-dom',
'javelin-util',
@@ -1768,6 +1761,13 @@
'javelin-workflow',
'phabricator-draggable-list',
),
+ 'bc0d23ab' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-dom',
+ 'javelin-vector',
+ 'javelin-install',
+ ),
'bd4c8dca' => array(
'javelin-install',
'javelin-util',
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

Mime Type
text/plain
Expires
Sun, Jan 12, 2:28 PM (20 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6986996
Default Alt Text
D15135.id36540.diff (2 KB)

Event Timeline