From 80be0607350411662e0fc9b46e11388f5bb6cb54 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 25 Jun 2014 13:08:28 +0800 Subject: select owner when creating repository --- public/js/app.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'public/js') 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); -- cgit v1.2.3 From 72ba273cc99589d7a0ca0a7986939e86f6599bf8 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 25 Jun 2014 16:03:29 +0800 Subject: select owner when creating repository --- public/js/app.js | 5 ++++- templates/repo/create.tmpl | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'public/js') diff --git a/public/js/app.js b/public/js/app.js index b33469d9..6edade44 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -770,7 +770,10 @@ function initRepoCreating() { $(this).parent().find(".checked").removeClass("checked"); $(this).addClass("checked"); } - console.log("set repo owner to uid :",uid); + // set button group to show clicked owner + $('#repo-owner-avatar').attr("src",$(this).find('img').attr("src")); + $('#repo-owner-name').text($(this).text().trim()); + console.log("set repo owner to uid :",uid,$(this).text().trim()); }); }()); console.log("init repo-creating scripts"); diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 3288b736..0eee1e57 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -9,9 +9,9 @@
-