aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorNorwin <noerw@users.noreply.github.com>2021-02-19 10:52:11 +0000
committerGitHub <noreply@github.com>2021-02-19 12:52:11 +0200
commitd38ae597e19f58bcd732717fe09c1ea97ab8bb12 (patch)
tree839f0b3c92a4b98a7be3b8aa316925615c16c76e /web_src
parent6a696b93b1e7e9dc1e7cc51d4eab2932b072170f (diff)
downloadgitea-d38ae597e19f58bcd732717fe09c1ea97ab8bb12.tar.gz
gitea-d38ae597e19f58bcd732717fe09c1ea97ab8bb12.zip
Add UI to delete tracked times (#14100)
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/index.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index c67b3c809b..848c88bb1f 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -3203,12 +3203,17 @@ function initVueApp() {
function initIssueTimetracking() {
$(document).on('click', '.issue-add-time', () => {
- $('.mini.modal').modal({
+ $('.issue-start-time-modal').modal({
duration: 200,
onApprove() {
$('#add_time_manual_form').trigger('submit');
}
}).modal('show');
+ $('.issue-start-time-modal input').on('keydown', (e) => {
+ if ((e.keyCode || e.key) === 13) {
+ $('#add_time_manual_form').trigger('submit');
+ }
+ });
});
$(document).on('click', '.issue-start-time, .issue-stop-time', () => {
$('#toggle_stopwatch_form').trigger('submit');
@@ -3216,6 +3221,15 @@ function initIssueTimetracking() {
$(document).on('click', '.issue-cancel-time', () => {
$('#cancel_stopwatch_form').trigger('submit');
});
+ $(document).on('click', 'button.issue-delete-time', function () {
+ const sel = `.issue-delete-time-modal[data-id="${$(this).data('id')}"]`;
+ $(sel).modal({
+ duration: 200,
+ onApprove() {
+ $(`${sel} form`).trigger('submit');
+ }
+ }).modal('show');
+ });
}
function initFilterBranchTagDropdown(selector) {