Changeset - c6dcda2c9402
[Not reviewed]
default
0 1 0
Takumi IINO - 10 years ago 2015-10-25 17:09:06
trot.thunder@gmail.com
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.
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/base/base.html
Show inline comments
 
@@ -260,26 +260,30 @@
 
      });
 

	
 
      $("#branch_switcher").on('select2-selecting', function(e) {
 
          e.preventDefault();
 
          var context = $('#context-bar .current').data('context');
 
          if (context == 'files') {
 
              window.location = pyroutes.url('files_home', {
 
                  'repo_name': REPO_NAME,
 
                  'revision': e.choice.id,
 
                  '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
 
              });
 
          }
 
      });
 
    });
 
  </script>
 
  <!--- END CONTEXT BAR -->
 
</%def>
 

	
 
<%def name="menu(current=None)">
0 comments (0 inline, 0 general)