automatically check the "patch proposed" checkbox on .patch upload
This commit is contained in:
parent
8c0d5aa80c
commit
939468a414
|
@ -105,4 +105,20 @@ $(function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
if ($('#attachments_fields').length) {
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
console.log(mutation);
|
||||
$('input.filename.readonly').each(function(idx, elem) {
|
||||
var filename = $(elem).val();
|
||||
var extension = filename.substring(filename.lastIndexOf('.'));
|
||||
if (extension == '.patch') {
|
||||
$('#issue_custom_field_values_2').prop('checked', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
var target = $('#attachments_fields')[0];
|
||||
observer.observe(target, {attributes: false, childList: true, characterData: false});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue