Allow committing / adding empty files using the web ui (#8420) (#8532)

* Allow committing / adding empty files from the web ui (#8420)

Signed-off-by: LukBukkit <luk.bukkit@gmail.com>

* Add a modal to confirm the commit of an empty file

Signed-off-by: LukBukkit <luk.bukkit@gmail.com>
This commit is contained in:
Lukas 2019-10-16 21:28:41 +02:00 committed by Lauris BH
parent d4cd4ed442
commit de4f10be86
4 changed files with 39 additions and 4 deletions

View file

@ -262,7 +262,7 @@ function initRepoStatusChecker() {
location.reload();
return
}
setTimeout(function () {
initRepoStatusChecker()
}, 2000);
@ -1571,6 +1571,18 @@ function initEditor() {
codeMirrorEditor.setOption("tabSize", editorconfig.tab_width || 4);
});
}).trigger('keyup');
$('#commit-button').click(function (event) {
// A modal which asks if an empty file should be committed
if ($editArea.val().length === 0) {
$('#edit-empty-content-modal').modal({
onApprove: function () {
$('.edit.form').submit();
}
}).modal('show');
event.preventDefault();
}
});
}
function initOrganization() {