mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-20 00:40:26 +00:00
* 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:
parent
d4cd4ed442
commit
de4f10be86
4 changed files with 39 additions and 4 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue