changeset 5580:c6dcda2c9402

select2: make "Switch To" switch to changelog view everywhere, except in Files context When already in changelog context, it will apply the change to the existing branch_filter.
author Takumi IINO <trot.thunder@gmail.com>
date Sun, 25 Oct 2015 16:09:06 +0000
parents a33448d81f70
children ef70f1594acf
files kallithea/templates/base/base.html
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/base/base.html	Tue Sep 16 14:44:18 2014 +0200
+++ b/kallithea/templates/base/base.html	Sun Oct 25 16:09:06 2015 +0000
@@ -269,8 +269,12 @@
                   'f_path': '',
                   'at': e.choice.text
               });
-          }
-          else if(context == 'summary' || context == 'changelog') {
+          } else if (context == 'changelog') {
+              if (e.choice.type == 'tag' || e.choice.type == 'book') {
+                  $("#branch_filter").append($('<option/>').val(e.choice.text));
+              }
+              $("#branch_filter").val(e.choice.text).change();
+          } else {
               window.location = pyroutes.url('changelog_home', {
                   'repo_name': '${c.repo_name}',
                   'branch': e.choice.text