2016-09-13 01:20:21 +02:00
|
|
|
/**
|
|
|
|
* @provides javelin-behavior-toggle-widget
|
|
|
|
* @requires javelin-behavior
|
|
|
|
* javelin-dom
|
|
|
|
* javelin-util
|
|
|
|
* javelin-workflow
|
|
|
|
* javelin-stratcom
|
|
|
|
*/
|
|
|
|
|
|
|
|
JX.behavior('toggle-widget', function(config) {
|
|
|
|
|
2016-10-19 06:49:02 +02:00
|
|
|
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();
|
|
|
|
|
2016-09-13 01:20:21 +02:00
|
|
|
function _toggleColumn(e) {
|
|
|
|
e.kill();
|
|
|
|
var node = JX.$('conpherence-main-layout');
|
|
|
|
config.show = !config.show;
|
|
|
|
JX.DOM.alterClass(node, 'hide-widgets', !config.show);
|
2016-09-15 03:34:11 +02:00
|
|
|
JX.Stratcom.invoke('resize');
|
2016-09-13 01:20:21 +02:00
|
|
|
|
2016-10-19 06:49:02 +02:00
|
|
|
if (device != 'phone') {
|
|
|
|
new JX.Request(config.settingsURI)
|
|
|
|
.setData({value: (config.show ? 1 : 0)})
|
|
|
|
.send();
|
|
|
|
}
|
2016-09-13 01:20:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
JX.Stratcom.listen(
|
|
|
|
'click',
|
|
|
|
'conpherence-widget-toggle',
|
|
|
|
_toggleColumn);
|
|
|
|
|
|
|
|
});
|