diff options
author | silverwind <me@silverwind.io> | 2021-04-10 01:42:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 19:42:38 -0400 |
commit | 216976247c1bb958f01a0b33c5f457d7fed62a4d (patch) | |
tree | 52b5013ceb9fe82e4664a51de2783f1517ff5bfd /templates/repo | |
parent | b9ed3cbc26ca20e0c88a66ed42dbc1268a2343bc (diff) | |
download | gitea-216976247c1bb958f01a0b33c5f457d7fed62a4d.tar.gz gitea-216976247c1bb958f01a0b33c5f457d7fed62a4d.zip |
Remove usage of JS globals (#15378)
Refactor the exported globals in index.js to JS-initialized event
handlers.
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/diff/comment_form.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index b12beeab82..c82d32c214 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -44,7 +44,7 @@ {{end}} {{end}} {{if or (not $.HasComments) $.hidden}} - <button type="button" class="ui submit tiny basic button btn-cancel" onclick="window.cancelCodeComment(this);">{{$.root.i18n.Tr "cancel"}}</button> + <button type="button" class="ui submit tiny basic button btn-cancel cancel-code-comment">{{$.root.i18n.Tr "cancel"}}</button> {{end}} </div> </div> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 872a86e658..30acb839b5 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -467,8 +467,7 @@ </div> <div class="item-right df ac"> {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} - <a class="delete-dependency-button poping up ci" onclick="window.deleteDependencyModal({{.Issue.ID}}, 'blocking');" - data-content="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted=""> + <a class="delete-dependency-button poping up ci" data-id="{{.Issue.ID}}" data-type="blocking" data-content="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted=""> {{svg "octicon-trash" 16}} </a> {{end}} @@ -495,8 +494,7 @@ </div> <div class="item-right df ac"> {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} - <a class="delete-dependency-button poping up ci" onclick="window.deleteDependencyModal({{.Issue.ID}}, 'blockedBy');" - data-content="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted=""> + <a class="delete-dependency-button poping up ci" data-id="{{.Issue.ID}}" data-type="blockedBy" data-content="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted=""> {{svg "octicon-trash" 16}} </a> {{end}} |