Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14376948
D12189.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D12189.diff
View Options
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' => '2ff29d1d',
- 'core.pkg.js' => '75599122',
+ 'core.pkg.js' => '2102d953',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '571b1cc1',
'differential.pkg.js' => 'c0506961',
@@ -44,7 +44,7 @@
'rsrc/css/application/config/config-welcome.css' => '6abd79be',
'rsrc/css/application/config/setup-issue.css' => '22270af2',
'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2',
- 'rsrc/css/application/conpherence/durable-column.css' => 'e11b2fbc',
+ 'rsrc/css/application/conpherence/durable-column.css' => 'e2011d85',
'rsrc/css/application/conpherence/menu.css' => '9b37a261',
'rsrc/css/application/conpherence/message-pane.css' => '69ff6e0f',
'rsrc/css/application/conpherence/notification.css' => '04a6e10a',
@@ -354,7 +354,7 @@
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'bb928342',
- 'rsrc/js/application/conpherence/behavior-durable-column.js' => '70787038',
+ 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'e5182926',
'rsrc/js/application/conpherence/behavior-menu.js' => 'de5579b4',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
@@ -457,7 +457,7 @@
'rsrc/js/core/behavior-choose-control.js' => '6153c708',
'rsrc/js/core/behavior-crop.js' => 'fa0f4fc2',
'rsrc/js/core/behavior-dark-console.js' => '08883e8b',
- 'rsrc/js/core/behavior-device.js' => '03d6ed07',
+ 'rsrc/js/core/behavior-device.js' => 'a205cf28',
'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '6d49590e',
'rsrc/js/core/behavior-error-log.js' => '6882e80a',
'rsrc/js/core/behavior-fancy-datepicker.js' => 'c51ae228',
@@ -514,7 +514,7 @@
'changeset-view-manager' => '58562350',
'config-options-css' => '7fedf08b',
'config-welcome-css' => '6abd79be',
- 'conpherence-durable-column-view' => 'e11b2fbc',
+ 'conpherence-durable-column-view' => 'e2011d85',
'conpherence-menu-css' => '9b37a261',
'conpherence-message-pane-css' => '69ff6e0f',
'conpherence-notification-css' => '04a6e10a',
@@ -566,7 +566,7 @@
'javelin-behavior-dashboard-move-panels' => '82439934',
'javelin-behavior-dashboard-query-panel-select' => '453c5375',
'javelin-behavior-dashboard-tab-panel' => 'd4eecc63',
- 'javelin-behavior-device' => '03d6ed07',
+ 'javelin-behavior-device' => 'a205cf28',
'javelin-behavior-differential-add-reviewers-and-ccs' => 'e10f8e18',
'javelin-behavior-differential-comment-jump' => '4fdb476d',
'javelin-behavior-differential-diff-radios' => 'e1ff79b1',
@@ -584,7 +584,7 @@
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
'javelin-behavior-doorkeeper-tag' => 'e5822781',
- 'javelin-behavior-durable-column' => '70787038',
+ 'javelin-behavior-durable-column' => 'e5182926',
'javelin-behavior-error-log' => '6882e80a',
'javelin-behavior-fancy-datepicker' => 'c51ae228',
'javelin-behavior-global-drag-and-drop' => 'bbdf75ca',
@@ -847,13 +847,6 @@
'029a133d' => array(
'aphront-dialog-view-css',
),
- '03d6ed07' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-dom',
- 'javelin-vector',
- 'javelin-install',
- ),
'05270951' => array(
'javelin-util',
'javelin-magical-init',
@@ -1334,16 +1327,6 @@
'6f7a9da8' => array(
'javelin-install',
),
- 70787038 => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-behavior-device',
- 'javelin-scrollbar',
- 'javelin-quicksand',
- 'phabricator-keyboard-shortcut',
- 'conpherence-thread-manager',
- ),
'70baed2f' => array(
'javelin-install',
'javelin-dom',
@@ -1618,6 +1601,13 @@
'javelin-vector',
'javelin-magical-init',
),
+ 'a205cf28' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-dom',
+ 'javelin-vector',
+ 'javelin-install',
+ ),
'a80d0378' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1864,6 +1854,16 @@
'javelin-behavior',
'javelin-dom',
),
+ 'e5182926' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-behavior-device',
+ 'javelin-scrollbar',
+ 'javelin-quicksand',
+ 'phabricator-keyboard-shortcut',
+ 'conpherence-thread-manager',
+ ),
'e566f52c' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/webroot/rsrc/css/application/conpherence/durable-column.css b/webroot/rsrc/css/application/conpherence/durable-column.css
--- a/webroot/rsrc/css/application/conpherence/durable-column.css
+++ b/webroot/rsrc/css/application/conpherence/durable-column.css
@@ -29,10 +29,6 @@
background: #fff;
}
-.device .conpherence-durable-column {
- display: none;
-}
-
.conpherence-durable-column .loading-mask {
position: absolute;
top: 90px;
diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
--- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
+++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
@@ -28,6 +28,10 @@
var loadThreadID = null;
var scrollbar = null;
+ var columnWidth = 300;
+ // This is the smallest window size where we'll enable the column.
+ var minimumViewportWidth = 768;
+
var quick = JX.$('phabricator-standard-page-body');
function _getColumnNode() {
@@ -39,14 +43,33 @@
return JX.DOM.find(column, 'div', 'conpherence-durable-column-main');
}
+ function _autocloseColumn() {
+ var viewport = JX.Vector.getViewport();
+ if (viewport.x < minimumViewportWidth) {
+ if (show) {
+ _toggleColumn(false);
+ resizeClose = true;
+ }
+ return true;
+ } else {
+ if (resizeClose) {
+ resizeClose = false;
+ if (!show) {
+ _toggleColumn(false);
+ }
+ }
+ }
+
+ return false;
+ }
+
function _toggleColumn(explicit) {
if (explicit) {
- var device = JX.Device.getDevice();
- // don't allow users to invoke the column from devices
- if (device != 'desktop') {
+ if (_autocloseColumn()) {
return;
}
}
+
show = !show;
JX.DOM.alterClass(document.body, 'with-durable-column', show);
var column = _getColumnNode();
@@ -59,6 +82,14 @@
JX.Stratcom.invoke('resize');
JX.Quicksand.setFrame(show ? quick : null);
+ // When we activate the column, adjust the tablet breakpoint so that we
+ // convert the left side of the screen to tablet mode on narrow displays.
+ var breakpoint = JX.Device.getTabletBreakpoint();
+ JX.Device.setTabletBreakpoint(
+ show ? (breakpoint + columnWidth) : (breakpoint - columnWidth));
+
+ JX.log(JX.Device.getTabletBreakpoint());
+
// If this was an explicit toggle action from the user, save their
// preference.
if (explicit) {
@@ -188,31 +219,7 @@
});
var resizeClose = false;
- JX.Stratcom.listen(
- 'phabricator-device-change',
- null,
- function() {
- var device = JX.Device.getDevice();
- switch (device) {
- case 'phone':
- case 'tablet':
- if (show === true) {
- _toggleColumn(false);
- resizeClose = true;
- }
- break;
- case 'desktop':
- if (resizeClose) {
- resizeClose = false;
- if (show === false) {
- _toggleColumn(false);
- }
- }
- break;
- default:
- break;
- }
- });
+ JX.Stratcom.listen('resize', null, _autocloseColumn);
function _getColumnBodyNode() {
var column = JX.$('conpherence-durable-column');
@@ -339,15 +346,8 @@
});
if (config.visible) {
- var device = JX.Device.getDevice();
- if (device == 'desktop') {
- _toggleColumn(false);
- } else {
- // pretend we closed due to resize so if we do resize later things work
- // correctly
- resizeClose = true;
- JX.DOM.hide(_getColumnNode());
- }
+ _toggleColumn(false);
+ _autocloseColumn();
}
});
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
@@ -10,12 +10,24 @@
JX.install('Device', {
statics : {
_device : null,
+ _tabletBreakpoint: 768,
+
+ setTabletBreakpoint: function(width) {
+ var self = JX.Device;
+ self._tabletBreakpoint = width;
+ self.recalculate();
+ },
+
+ getTabletBreakpoint: function() {
+ return JX.Device._tabletBreakpoint;
+ },
+
recalculate: function() {
var v = JX.Vector.getViewport();
var self = JX.Device;
var device = 'desktop';
- if (v.x <= 768) {
+ if (v.x <= self._tabletBreakpoint) {
device = 'tablet';
}
if (v.x <= 480) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 12:31 AM (21 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6916732
Default Alt Text
D12189.diff (9 KB)
Attached To
Mode
D12189: Improve column device behaviors
Attached
Detach File
Event Timeline
Log In to Comment