1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-23 02:38:48 +02:00
phorge-phorge/webroot/rsrc/js/application/conpherence/behavior-toggle-widget.js
Chad Little ff64c4e02b 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
2016-09-12 23:20:21 +00:00

28 lines
626 B
JavaScript

/**
* @provides javelin-behavior-toggle-widget
* @requires javelin-behavior
* javelin-dom
* javelin-util
* javelin-workflow
* javelin-stratcom
*/
JX.behavior('toggle-widget', function(config) {
function _toggleColumn(e) {
e.kill();
var node = JX.$('conpherence-main-layout');
config.show = !config.show;
JX.DOM.alterClass(node, 'hide-widgets', !config.show);
new JX.Request(config.settingsURI)
.setData({value: (config.show ? 1 : 0)})
.send();
}
JX.Stratcom.listen(
'click',
'conpherence-widget-toggle',
_toggleColumn);
});