Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/conpherence/behavior-toggle-widget.js
- This file was added.
/** | |||||
* @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); | |||||
epriestley: Oh, sorry -- //this// one needs to be flipped. Seems to work correctly to me with this change… | |||||
new JX.Request(config.settingsURI) | |||||
Not Done Inline ActionsInstead of doing this classname test, just do: config.show = !config.show; JX.DOM.alterClass(node, 'hide-widgets', config.show); epriestley: Instead of doing this classname test, just do:
```
config.show = !config.show;
JX.DOM. | |||||
Not Done Inline Actionshaving trouble with it taking two clicks to toggle the first load. I think thats why I did the check, to read it right off the node. chad: having trouble with it taking two clicks to toggle the first load. I think thats why I did the… | |||||
.setData({value: (config.show ? 1 : 0)}) | |||||
.send(); | |||||
} | |||||
Not Done Inline ActionsAs written, this does the wrong thing if you click twice (or any other even number of times), since we never change config.show. That is:
epriestley: As written, this does the wrong thing if you click //twice// (or any other even number of… | |||||
Not Done Inline ActionsDoes this need to be flipped, since you're flipping config.show before getting here? epriestley: Does this need to be flipped, since you're flipping `config.show` before getting here? | |||||
Not Done Inline ActionsIf I flip it, still takes two clicks to show or hide the column, however we send two setting requests so then it seems broken. chad: If I flip it, still takes two clicks to show or hide the column, however we send two setting… | |||||
JX.Stratcom.listen( | |||||
'click', | |||||
'conpherence-widget-toggle', | |||||
_toggleColumn); | |||||
}); |
Oh, sorry -- this one needs to be flipped. Seems to work correctly to me with this change to add an !: