errors. Summary: Make sure reviewers know what they are doing. Test Plan: Tested with different diffs that had lint and unit problems. Reviewed By: epriestley Reviewers: epriestley, jungejason CC: grglr, aran, epriestley, tuomaspelkonen Differential Revision: 432
29 lines
655 B
JavaScript
29 lines
655 B
JavaScript
/**
|
|
* @provides javelin-behavior-differential-accept-with-errors
|
|
* @requires javelin-behavior
|
|
* javelin-dom
|
|
*/
|
|
|
|
JX.behavior('differential-accept-with-errors', function(config) {
|
|
|
|
function toggleWarning(control) {
|
|
if (control) {
|
|
JX.DOM.hide(JX.$(control));
|
|
JX.DOM.listen(
|
|
JX.$(config.select),
|
|
'change',
|
|
null,
|
|
function(e) {
|
|
if (JX.$(config.select).value == 'accept') {
|
|
JX.DOM.show(JX.$(control));
|
|
} else {
|
|
JX.DOM.hide(JX.$(control));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
toggleWarning(config.unit_warning);
|
|
toggleWarning(config.lint_warning);
|
|
});
|