mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Toggle accept warnings on reload
Summary: We now remember this value, it's remembered also after page refresh. Test Plan: Reloaded revision about to be accepted. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4196
This commit is contained in:
parent
79b241b31d
commit
7dff7bf049
1 changed files with 13 additions and 15 deletions
|
@ -5,23 +5,21 @@
|
|||
*/
|
||||
|
||||
JX.behavior('differential-accept-with-errors', function(config) {
|
||||
if (config.warnings) {
|
||||
toggleWarning();
|
||||
JX.DOM.listen(
|
||||
JX.$(config.select),
|
||||
'change',
|
||||
null,
|
||||
toggleWarning);
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
});
|
||||
function toggleWarning() {
|
||||
if (JX.$(config.select).value == 'accept') {
|
||||
JX.DOM.show(JX.$(config.warnings));
|
||||
} else {
|
||||
JX.DOM.hide(JX.$(config.warnings));
|
||||
}
|
||||
}
|
||||
|
||||
toggleWarning(config.warnings);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue