From 80be0607350411662e0fc9b46e11388f5bb6cb54 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 25 Jun 2014 13:08:28 +0800 Subject: [PATCH] select owner when creating repository --- public/js/app.js | 21 +++++++++++++++++++++ templates/repo/create.tmpl | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/public/js/app.js b/public/js/app.js index 2359e7ea..b33469d9 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -758,6 +758,24 @@ function initRepoSetting() { }); } +function initRepoCreating() { + // owner switch menu click + (function () { + $('#repo-owner-switch .dropdown-menu').on("click", "li", function () { + var uid = $(this).data('uid'); + // set to input + $('#repo-owner-id').val(uid); + // set checked class + if (!$(this).hasClass("checked")) { + $(this).parent().find(".checked").removeClass("checked"); + $(this).addClass("checked"); + } + console.log("set repo owner to uid :",uid); + }); + }()); + console.log("init repo-creating scripts"); +} + (function ($) { $(function () { initCore(); @@ -780,6 +798,9 @@ function initRepoSetting() { if ($('#repo-setting-container').length) { initRepoSetting(); } + if ($('#repo-create').length) { + initRepoCreating(); + } }); })(jQuery); diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index fc0eb371..c3ba89ae 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -29,7 +29,7 @@ - +