Re-enabled experiment timeline if it is not empty. (#1307)
This commit is contained in:
Родитель
14d890ce1b
Коммит
12ae9e0166
|
@ -1,22 +1,28 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
const fields = document.querySelectorAll('input, textarea');
|
||||
for (let i = 0; i < fields.length; ++i) {
|
||||
fields[i].addEventListener('blur', (e) => {
|
||||
e.target.classList.add('interacted');
|
||||
const fields = document.querySelectorAll('input, textarea');
|
||||
for (let i = 0; i < fields.length; ++i) {
|
||||
fields[i].addEventListener('blur', (e) => {
|
||||
e.target.classList.add('interacted');
|
||||
});
|
||||
}
|
||||
|
||||
// Allow editing if there was already a value specified in this
|
||||
// deprecated field.
|
||||
const timelineField = document.querySelector('#id_experiment_timeline');
|
||||
if (timelineField && timelineField.value) {
|
||||
timelineField.disabled = '';
|
||||
}
|
||||
|
||||
|
||||
if (document.querySelector('#cancel-button')) {
|
||||
document.querySelector('#cancel-button').addEventListener('click', (e) => {
|
||||
window.location.href = `/guide/edit/${e.currentTarget.dataset.id}`;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.body.classList.remove('loading');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (document.querySelector('#cancel-button')) {
|
||||
document.querySelector('#cancel-button').addEventListener('click', (e) => {
|
||||
window.location.href = `/guide/edit/${e.currentTarget.dataset.id}`;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.body.classList.remove('loading');
|
||||
});
|
||||
})();
|
||||
|
|
Загрузка…
Ссылка в новой задаче