mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +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) {
|
JX.behavior('differential-accept-with-errors', function(config) {
|
||||||
|
if (config.warnings) {
|
||||||
function toggleWarning(control) {
|
toggleWarning();
|
||||||
if (control) {
|
|
||||||
JX.DOM.hide(JX.$(control));
|
|
||||||
JX.DOM.listen(
|
JX.DOM.listen(
|
||||||
JX.$(config.select),
|
JX.$(config.select),
|
||||||
'change',
|
'change',
|
||||||
null,
|
null,
|
||||||
function(e) {
|
toggleWarning);
|
||||||
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