diff options
Diffstat (limited to 'public/ng/js/gogs.js')
-rw-r--r-- | public/ng/js/gogs.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index a861255e3e..37144ce99e 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -174,11 +174,31 @@ function initRepoCreate() { console.log('initRepoCreate'); } +function initRepoSetting() { + // Confirmation of changing repository name. + $('#repo-setting-form').submit(function (e) { + var $reponame = $('#repo_name'); + if (($reponame.data('repo-name') != $reponame.val()) && !confirm('Repository name has been changed, do you want to continue?')) { + e.preventDefault(); + return true; + } + }); + $('#transfer-button').click(function () { + $('#transfer-form').show(); + }); + $('#delete-button').click(function () { + $('#delete-form').show(); + }); +} + $(document).ready(function () { initCore(); if ($('#repo-create-form').length || $('#repo-migrate-form').length) { initRepoCreate(); } + if ($('#repo-setting').length) { + initRepoSetting(); + } Tabs('#dashboard-sidebar-menu'); |