1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 20:52:43 +01:00
phorge-phorge/webroot/rsrc/js/application/differential/behavior-show-field-details.js
epriestley f04d8ab1a7 Further improve unit/lint rendering
Summary:
I think this improves things, let me know if you have feedback.

Also addresses T840.

Test Plan: See screenshots...

Reviewers: vrana, btrahan, jungejason

Reviewed By: vrana

CC: aran, zeeg

Maniphest Tasks: T840

Differential Revision: https://secure.phabricator.com/D2357
2012-05-01 10:15:56 -07:00

40 lines
975 B
JavaScript

/**
* @provides javelin-behavior-differential-show-field-details
* @requires javelin-behavior
* javelin-stratcom
* javelin-dom
*/
JX.behavior('differential-show-field-details', function(config) {
JX.Stratcom.listen(
'click',
['differential-results-row-show', 'tag:a'],
function(e) {
toggle(e, true);
});
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'));
}
});