mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
89f0015ae6
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
45 lines
1,005 B
JavaScript
45 lines
1,005 B
JavaScript
/**
|
|
* @provides javelin-behavior-toggle-widget
|
|
* @requires javelin-behavior
|
|
* javelin-dom
|
|
* javelin-util
|
|
* javelin-workflow
|
|
* javelin-stratcom
|
|
*/
|
|
|
|
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) {
|
|
e.kill();
|
|
var node = JX.$('conpherence-main-layout');
|
|
config.show = !config.show;
|
|
JX.DOM.alterClass(node, 'hide-widgets', !config.show);
|
|
JX.Stratcom.invoke('resize');
|
|
|
|
if (device != 'phone') {
|
|
new JX.Request(config.settingsURI)
|
|
.setData({value: (config.show ? 1 : 0)})
|
|
.send();
|
|
}
|
|
}
|
|
|
|
JX.Stratcom.listen(
|
|
'click',
|
|
'conpherence-widget-toggle',
|
|
_toggleColumn);
|
|
|
|
});
|