1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Don't show participants in Conpherence left open on mobile

Summary: Fixes T11764. Moves rendering of the column to client-side, which can skip if it detects we're on mobile.

Test Plan: Open column on desktop, switch to mobile, don't see column. Toggle column on mobile on and off. Switch back to desktop.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11764

Differential Revision: https://secure.phabricator.com/D16725
This commit is contained in:
Chad Little 2016-10-18 21:49:02 -07:00
parent b750c0a218
commit 89f0015ae6
4 changed files with 53 additions and 78 deletions

View file

@ -8,7 +8,7 @@
return array( return array(
'names' => array( 'names' => array(
'conpherence.pkg.css' => 'fabab894', 'conpherence.pkg.css' => 'fabab894',
'conpherence.pkg.js' => 'cbe4d9be', 'conpherence.pkg.js' => '6249a1cf',
'core.pkg.css' => 'b99bbf5e', 'core.pkg.css' => 'b99bbf5e',
'core.pkg.js' => '2d9fc958', 'core.pkg.js' => '2d9fc958',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
@ -438,11 +438,11 @@ return array(
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '358c717b', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '358c717b',
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762', 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034', 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034',
'rsrc/js/application/conpherence/behavior-menu.js' => '07928ca3', 'rsrc/js/application/conpherence/behavior-menu.js' => '7524fcfa',
'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8',
'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483', 'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
'rsrc/js/application/conpherence/behavior-toggle-widget.js' => '9bdbbab0', 'rsrc/js/application/conpherence/behavior-toggle-widget.js' => '3dbf94d5',
'rsrc/js/application/countdown/timer.js' => 'e4cc26b3', 'rsrc/js/application/countdown/timer.js' => 'e4cc26b3',
'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145', 'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e', 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e',
@ -663,7 +663,7 @@ return array(
'javelin-behavior-choose-control' => '327a00d1', 'javelin-behavior-choose-control' => '327a00d1',
'javelin-behavior-comment-actions' => '0300eae6', 'javelin-behavior-comment-actions' => '0300eae6',
'javelin-behavior-config-reorder-fields' => 'b6993408', 'javelin-behavior-config-reorder-fields' => 'b6993408',
'javelin-behavior-conpherence-menu' => '07928ca3', 'javelin-behavior-conpherence-menu' => '7524fcfa',
'javelin-behavior-conpherence-participant-pane' => '8604caa8', 'javelin-behavior-conpherence-participant-pane' => '8604caa8',
'javelin-behavior-conpherence-pontificate' => 'f2e58483', 'javelin-behavior-conpherence-pontificate' => 'f2e58483',
'javelin-behavior-conpherence-search' => '9bbf3762', 'javelin-behavior-conpherence-search' => '9bbf3762',
@ -772,7 +772,7 @@ return array(
'javelin-behavior-test-payment-form' => 'fc91ab6c', 'javelin-behavior-test-payment-form' => 'fc91ab6c',
'javelin-behavior-time-typeahead' => '522431f7', 'javelin-behavior-time-typeahead' => '522431f7',
'javelin-behavior-toggle-class' => '92b9ec77', 'javelin-behavior-toggle-class' => '92b9ec77',
'javelin-behavior-toggle-widget' => '9bdbbab0', 'javelin-behavior-toggle-widget' => '3dbf94d5',
'javelin-behavior-typeahead-browse' => '635de1ec', 'javelin-behavior-typeahead-browse' => '635de1ec',
'javelin-behavior-typeahead-search' => '93d0c9e3', 'javelin-behavior-typeahead-search' => '93d0c9e3',
'javelin-behavior-view-placeholder' => '47830651', 'javelin-behavior-view-placeholder' => '47830651',
@ -1029,20 +1029,6 @@ return array(
'phabricator-prefab', 'phabricator-prefab',
'phuix-icon-view', 'phuix-icon-view',
), ),
'07928ca3' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'javelin-behavior-device',
'javelin-history',
'javelin-vector',
'javelin-scrollbar',
'phabricator-title',
'phabricator-shaped-request',
'conpherence-thread-manager',
),
'08675c6d' => array( '08675c6d' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-behavior-device', 'javelin-behavior-device',
@ -1227,6 +1213,13 @@ return array(
'javelin-util', 'javelin-util',
'javelin-uri', 'javelin-uri',
), ),
'3dbf94d5' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-workflow',
'javelin-stratcom',
),
'3f5d6dbf' => array( '3f5d6dbf' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -1548,6 +1541,20 @@ return array(
'javelin-vector', 'javelin-vector',
'javelin-dom', 'javelin-dom',
), ),
'7524fcfa' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'javelin-behavior-device',
'javelin-history',
'javelin-vector',
'javelin-scrollbar',
'phabricator-title',
'phabricator-shaped-request',
'conpherence-thread-manager',
),
'769d3498' => array( '769d3498' => array(
'syntax-default-css', 'syntax-default-css',
), ),
@ -1766,13 +1773,6 @@ return array(
'javelin-workflow', 'javelin-workflow',
'javelin-stratcom', 'javelin-stratcom',
), ),
'9bdbbab0' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-workflow',
'javelin-stratcom',
),
'9ef7d354' => array( '9ef7d354' => array(
'phui-inline-comment-view-css', 'phui-inline-comment-view-css',
), ),

View file

@ -61,26 +61,17 @@ final class ConpherenceLayoutView extends AphrontTagView {
return $this; return $this;
} }
public function getWidgetColumnVisible() {
$widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY;
$user = $this->getUser();
return (bool)$user->getUserSetting($widget_key, false);
}
protected function getTagAttributes() { protected function getTagAttributes() {
$classes = array(); $classes = array();
if (!$this->getWidgetColumnVisible()) { $classes[] = 'conpherence-layout';
$classes[] = 'hide-widgets'; $classes[] = 'hide-widgets';
} $classes[] = 'conpherence-role-'.$this->role;
return array( return array(
'id' => 'conpherence-main-layout', 'id' => 'conpherence-main-layout',
'sigil' => 'conpherence-layout', 'sigil' => 'conpherence-layout',
'class' => 'conpherence-layout '. 'class' => implode(' ', $classes),
implode(' ', $classes).
' conpherence-role-'.$this->role,
); );
} }
protected function getTagContent() { protected function getTagContent() {

View file

@ -191,16 +191,6 @@ JX.behavior('conpherence-menu', function(config) {
if (_thread.visible !== null || !config.hasWidgets) { if (_thread.visible !== null || !config.hasWidgets) {
reloadWidget(data); reloadWidget(data);
} else {
JX.Stratcom.invoke(
'conpherence-update-widgets',
null,
{
widget : getDefaultWidget(),
buildSelectors : false,
toggleWidget : true,
threadID : _thread.selected
});
} }
_thread.visible = _thread.selected; _thread.visible = _thread.selected;
@ -259,32 +249,10 @@ JX.behavior('conpherence-menu', function(config) {
var root = JX.DOM.find(document, 'div', 'conpherence-layout'); var root = JX.DOM.find(document, 'div', 'conpherence-layout');
var widgets_root = JX.DOM.find(root, 'div', 'conpherence-widgets-holder'); var widgets_root = JX.DOM.find(root, 'div', 'conpherence-widgets-holder');
JX.DOM.setContent(widgets_root, JX.$H(response.widgets)); JX.DOM.setContent(widgets_root, JX.$H(response.widgets));
JX.Stratcom.invoke(
'conpherence-update-widgets',
null,
{
widget : widget,
buildSelectors : true,
toggleWidget : true,
threadID : _thread.selected
});
markWidgetLoading(false);
} }
function getDefaultWidget() { function getDefaultWidget() {
var device = JX.Device.getDevice(); return 'widgets-people';
var widget = 'conpherence-message-pane';
if (device == 'desktop') {
widget = 'widgets-people';
var uri = JX.$U(location.href);
var params = uri.getQueryParams();
if ('settings' in params) {
widget = 'widgets-settings';
}
}
return widget;
} }
/** /**

View file

@ -9,6 +9,20 @@
JX.behavior('toggle-widget', function(config) { JX.behavior('toggle-widget', function(config) {
var device;
function init() {
device = JX.Device.getDevice();
if (device != 'phone') {
var node = JX.$('conpherence-main-layout');
JX.DOM.alterClass(node, 'hide-widgets', !config.show);
JX.Stratcom.invoke('resize');
} else {
config.show = 0;
}
}
init();
function _toggleColumn(e) { function _toggleColumn(e) {
e.kill(); e.kill();
var node = JX.$('conpherence-main-layout'); var node = JX.$('conpherence-main-layout');
@ -16,10 +30,12 @@ JX.behavior('toggle-widget', function(config) {
JX.DOM.alterClass(node, 'hide-widgets', !config.show); JX.DOM.alterClass(node, 'hide-widgets', !config.show);
JX.Stratcom.invoke('resize'); JX.Stratcom.invoke('resize');
if (device != 'phone') {
new JX.Request(config.settingsURI) new JX.Request(config.settingsURI)
.setData({value: (config.show ? 1 : 0)}) .setData({value: (config.show ? 1 : 0)})
.send(); .send();
} }
}
JX.Stratcom.listen( JX.Stratcom.listen(
'click', 'click',