1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 13:00:56 +01:00

Conpherence - support device in durable column

Summary:
Ref T7014. This makes it so

 - you can't invoke the column from a device
 - if you are in desktop size and resize to tablet or phone, the column closes.
 - if you resize desktop -> device -> desktop, the column closes at device size and reopens at desktop size
 - if you load, then resize device -> desktop the column opens if the user has that preference
 - there is a brief flicker when you load on 'device' with the column open preference. it lasts as long as the js stack takes to calculate the device css rule.

Test Plan: see summary but i did stuff to do all that

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7014

Differential Revision: https://secure.phabricator.com/D12052
This commit is contained in:
Bob Trahan 2015-03-12 12:23:31 -07:00
parent f77c5c514b
commit eed10e47c9
3 changed files with 64 additions and 16 deletions

View file

@ -44,7 +44,7 @@ return array(
'rsrc/css/application/config/config-welcome.css' => '6abd79be', 'rsrc/css/application/config/config-welcome.css' => '6abd79be',
'rsrc/css/application/config/setup-issue.css' => '22270af2', 'rsrc/css/application/config/setup-issue.css' => '22270af2',
'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', 'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2',
'rsrc/css/application/conpherence/durable-column.css' => 'e3433ca7', 'rsrc/css/application/conpherence/durable-column.css' => '7c5f3bf5',
'rsrc/css/application/conpherence/menu.css' => 'c6ac5299', 'rsrc/css/application/conpherence/menu.css' => 'c6ac5299',
'rsrc/css/application/conpherence/message-pane.css' => '5930260a', 'rsrc/css/application/conpherence/message-pane.css' => '5930260a',
'rsrc/css/application/conpherence/notification.css' => '04a6e10a', 'rsrc/css/application/conpherence/notification.css' => '04a6e10a',
@ -353,7 +353,7 @@ return array(
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '0324970d', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '0324970d',
'rsrc/js/application/conpherence/behavior-durable-column.js' => '44100dc7', 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'ad539b06',
'rsrc/js/application/conpherence/behavior-menu.js' => 'c4151295', 'rsrc/js/application/conpherence/behavior-menu.js' => 'c4151295',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
@ -514,7 +514,7 @@ return array(
'changeset-view-manager' => '88be0133', 'changeset-view-manager' => '88be0133',
'config-options-css' => '7fedf08b', 'config-options-css' => '7fedf08b',
'config-welcome-css' => '6abd79be', 'config-welcome-css' => '6abd79be',
'conpherence-durable-column-view' => 'e3433ca7', 'conpherence-durable-column-view' => '7c5f3bf5',
'conpherence-menu-css' => 'c6ac5299', 'conpherence-menu-css' => 'c6ac5299',
'conpherence-message-pane-css' => '5930260a', 'conpherence-message-pane-css' => '5930260a',
'conpherence-notification-css' => '04a6e10a', 'conpherence-notification-css' => '04a6e10a',
@ -585,7 +585,7 @@ return array(
'javelin-behavior-diffusion-locate-file' => '6d3e1947', 'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192', 'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
'javelin-behavior-doorkeeper-tag' => 'e5822781', 'javelin-behavior-doorkeeper-tag' => 'e5822781',
'javelin-behavior-durable-column' => '44100dc7', 'javelin-behavior-durable-column' => 'ad539b06',
'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-error-log' => '6882e80a',
'javelin-behavior-fancy-datepicker' => 'c51ae228', 'javelin-behavior-fancy-datepicker' => 'c51ae228',
'javelin-behavior-global-drag-and-drop' => '07f199d8', 'javelin-behavior-global-drag-and-drop' => '07f199d8',
@ -1110,15 +1110,6 @@ return array(
'javelin-dom', 'javelin-dom',
'javelin-request', 'javelin-request',
), ),
'44100dc7' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-scrollbar',
'javelin-quicksand',
'phabricator-keyboard-shortcut',
'conpherence-thread-manager',
),
'44168bad' => array( '44168bad' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -1673,6 +1664,16 @@ return array(
'javelin-util', 'javelin-util',
'phabricator-prefab', 'phabricator-prefab',
), ),
'ad539b06' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-behavior-device',
'javelin-scrollbar',
'javelin-quicksand',
'phabricator-keyboard-shortcut',
'conpherence-thread-manager',
),
'b1f0ccee' => array( 'b1f0ccee' => array(
'javelin-install', 'javelin-install',
'javelin-dom', 'javelin-dom',

View file

@ -15,6 +15,10 @@
background: #fff; background: #fff;
} }
.device .conpherence-durable-column {
display: none;
}
.conpherence-durable-column .loading-mask { .conpherence-durable-column .loading-mask {
position: absolute; position: absolute;
top: 90px; top: 90px;
@ -27,7 +31,7 @@
z-index: 2; z-index: 2;
} }
.conpherence-durable-column.loading .loading-mask { .device-desktop .conpherence-durable-column.loading .loading-mask {
display: block; display: block;
} }

View file

@ -3,6 +3,7 @@
* @requires javelin-behavior * @requires javelin-behavior
* javelin-dom * javelin-dom
* javelin-stratcom * javelin-stratcom
* javelin-behavior-device
* javelin-scrollbar * javelin-scrollbar
* javelin-quicksand * javelin-quicksand
* phabricator-keyboard-shortcut * phabricator-keyboard-shortcut
@ -40,9 +41,16 @@ JX.behavior('durable-column', function(config, statics) {
} }
function _toggleColumn(explicit) { function _toggleColumn(explicit) {
if (explicit) {
var device = JX.Device.getDevice();
// don't allow users to invoke the column from devices
if (device != 'desktop') {
return;
}
}
show = !show; show = !show;
JX.DOM.alterClass(frame, 'with-durable-column', show); JX.DOM.alterClass(frame, 'with-durable-column', show);
var column = JX.$('conpherence-durable-column'); var column = _getColumnNode();
if (show) { if (show) {
JX.DOM.show(column); JX.DOM.show(column);
threadManager.loadThreadByID(loadThreadID); threadManager.loadThreadByID(loadThreadID);
@ -181,6 +189,33 @@ JX.behavior('durable-column', function(config, statics) {
threadManager.loadThreadByID(data.threadID); threadManager.loadThreadByID(data.threadID);
}); });
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;
}
});
function _getColumnBodyNode() { function _getColumnBodyNode() {
var column = JX.$('conpherence-durable-column'); var column = JX.$('conpherence-durable-column');
return JX.DOM.find( return JX.DOM.find(
@ -255,7 +290,15 @@ JX.behavior('durable-column', function(config, statics) {
}); });
if (config.visible) { if (config.visible) {
var device = JX.Device.getDevice();
if (device == 'desktop') {
_toggleColumn(false); _toggleColumn(false);
} else {
// pretend we closed due to resize so if we do resize later things work
// correctly
resizeClose = true;
JX.DOM.hide(_getColumnNode());
}
} }
}); });