diff --git a/public/js/gogs.js b/public/js/gogs.js
index be17b8c8f2..427280db54 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -218,8 +218,9 @@ function initRepository() {
});
}
- // File list
- if ($('.repository.file.list').length > 0) {
+ // File list and commits
+ if ($('.repository.file.list').length > 0 ||
+ ('.repository.commits').length > 0) {
initFilterSearchDropdown('.choose.reference .dropdown');
$('.reference.column').click(function () {
@@ -1036,4 +1037,4 @@ $(window).load(function () {
}
}).trigger('hashchange');
}
-});
\ No newline at end of file
+});
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl
new file mode 100644
index 0000000000..a825ee243c
--- /dev/null
+++ b/templates/repo/branch_dropdown.tmpl
@@ -0,0 +1,44 @@
+
+
+
+
+
+ {{if .IsViewBranch}}{{.i18n.Tr "repo.branch"}}{{else}}{{.i18n.Tr "repo.tree"}}{{end}}:
+ {{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}
+
+
+
+
+
+
diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl
index 879f762dfa..88a87ef8ce 100644
--- a/templates/repo/commits.tmpl
+++ b/templates/repo/commits.tmpl
@@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/branch_dropdown" .}}
{{template "repo/commits_table" .}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index ccbe6639cf..22a2f839a5 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -15,50 +15,7 @@
{{end}}
-
-
-
-
-
- {{if .IsViewBranch}}{{.i18n.Tr "repo.branch"}}{{else}}{{.i18n.Tr "repo.tree"}}{{end}}:
- {{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}
-
-
-
-
-
-
+ {{template "repo/branch_dropdown" .}}