aboutsummaryrefslogtreecommitdiff
path: root/public/js/app.js
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-06-28 14:58:59 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-06-28 14:58:59 +0800
commit86e2627175ceaed544dabbbef40d9197995c2bd4 (patch)
tree820eb7762ca0d3fa4f14e657a1ce2aa9f4b73617 /public/js/app.js
parente5ae41e21f7fa1e25f04a28d907b89c78196c824 (diff)
parentee9b7f322ff4c4c14952c2f83fb03e90fa583cad (diff)
Merge branch 'master' of github.com:gogits/gogs
Conflicts: models/update.go routers/repo/http.go
Diffstat (limited to 'public/js/app.js')
-rw-r--r--public/js/app.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/public/js/app.js b/public/js/app.js
index 2359e7ea..6edade44 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -758,6 +758,27 @@ 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");
+ }
+ // 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");
+}
+
(function ($) {
$(function () {
initCore();
@@ -780,6 +801,9 @@ function initRepoSetting() {
if ($('#repo-setting-container').length) {
initRepoSetting();
}
+ if ($('#repo-create').length) {
+ initRepoCreating();
+ }
});
})(jQuery);