1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 17:02:41 +01:00
phorge-phorge/webroot/rsrc/js/application/differential/behavior-show-field-details.js
Joshua Spence a0d63322b1 Remove unused JavaScript variables.
Summary: There are a bunch of unused variables in JavaScript files. These were identified with JSHint.

Test Plan: It's pretty hard to test this thoroughly... on inspection, it seems that everything //should// be okay (unless we are doing weird things with the JavaScript).

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9676
2014-06-24 03:27:47 +10:00

40 lines
969 B
JavaScript

/**
* @provides javelin-behavior-differential-show-field-details
* @requires javelin-behavior
* javelin-stratcom
* javelin-dom
*/
JX.behavior('differential-show-field-details', function() {
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'));
}
});