Add a toggle, sticky pref, for Conpherence Widget Pane
Summary: This adds a "column" icon into crumbs, like in workboards, for expanding or hiding the "Widget Pane". This is per user sticky and defaults to off. Test Plan: View a Conpherence Room, see no widgets by default. Toggle it on, see widget. Reload page, see widget stick. Verify mobile, tablets ignore hiding. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T10364 Differential Revision: https://secure.phabricator.com/D16533
This commit is contained in:
@@ -80,6 +80,27 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(true));
|
||||
|
||||
$widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY;
|
||||
$widget_view = (bool)$viewer->getUserSetting($widget_key, false);
|
||||
|
||||
$divider = id(new PHUIListItemView())
|
||||
->setType(PHUIListItemView::TYPE_DIVIDER)
|
||||
->addClass('conpherence-header-desktop-item');
|
||||
$crumbs->addAction($divider);
|
||||
|
||||
Javelin::initBehavior(
|
||||
'toggle-widget',
|
||||
array(
|
||||
'show' => (int)$widget_view,
|
||||
'settingsURI' => '/settings/adjust/?key='.$widget_key,
|
||||
));
|
||||
|
||||
$crumbs->addAction(
|
||||
id(new PHUIListItemView())
|
||||
->addSigil('conpherence-widget-toggle')
|
||||
->setIcon('fa-columns')
|
||||
->addClass('conpherence-header-desktop-item'));
|
||||
|
||||
return hsprintf(
|
||||
'%s',
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user