2012-05-01 01:08:01 +02:00
|
|
|
/**
|
|
|
|
* @provides javelin-behavior-differential-show-field-details
|
|
|
|
* @requires javelin-behavior
|
|
|
|
* javelin-stratcom
|
|
|
|
* javelin-dom
|
|
|
|
*/
|
|
|
|
|
2014-06-23 19:27:47 +02:00
|
|
|
JX.behavior('differential-show-field-details', function() {
|
2012-05-01 01:08:01 +02:00
|
|
|
|
|
|
|
JX.Stratcom.listen(
|
|
|
|
'click',
|
2012-05-01 19:15:56 +02:00
|
|
|
['differential-results-row-show', 'tag:a'],
|
2012-05-01 01:08:01 +02:00
|
|
|
function(e) {
|
2012-05-01 19:15:56 +02:00
|
|
|
toggle(e, true);
|
2012-05-01 01:08:01 +02:00
|
|
|
});
|
|
|
|
|
2012-05-01 19:15:56 +02:00
|
|
|
JX.Stratcom.listen(
|
|
|
|
'click',
|
|
|
|
['differential-results-row-hide', 'tag:a'],
|
|
|
|
function(e) {
|
|
|
|
toggle(e, false);
|
|
|
|
});
|
|
|
|
|
|
|
|
function toggle(e, show) {
|
|
|
|
e.kill();
|
|
|
|
|
|
|
|
var f = show ? JX.DOM.show : JX.DOM.hide;
|
|
|
|
var g = show ? JX.DOM.hide : JX.DOM.show;
|
|
|
|
|
|
|
|
var table = e.getNode('differential-results-table');
|
|
|
|
var rows = JX.DOM.scry(table, 'tr', 'differential-results-row-toggle');
|
|
|
|
for (var ii = 0; ii < rows.length; ii++) {
|
|
|
|
f(rows[ii]);
|
|
|
|
}
|
|
|
|
|
|
|
|
g(JX.DOM.find(table, 'tr', 'differential-results-row-show'));
|
|
|
|
f(JX.DOM.find(table, 'tr', 'differential-results-row-hide'));
|
|
|
|
}
|
|
|
|
|
2012-05-01 01:08:01 +02:00
|
|
|
});
|