Ajax branch/tag switch for tree view
This commit is contained in:
parent
97e9774336
commit
ae5faf0fd3
11 changed files with 151 additions and 110 deletions
|
@ -1,12 +1,19 @@
|
|||
%ul.breadcrumb
|
||||
%li
|
||||
= form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form left", :remote => true do
|
||||
= select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select"
|
||||
= hidden_field_tag :destination, "tree"
|
||||
= hidden_field_tag :path, params[:path]
|
||||
|
||||
%li
|
||||
= link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do
|
||||
= @project.code
|
||||
- tree.breadcrumbs(6) do |link|
|
||||
\/
|
||||
%li= link
|
||||
%span.tree_progress
|
||||
.clear
|
||||
%div.tree_progress
|
||||
= image_tag "ajax-loader.gif"
|
||||
#tree-content-holder
|
||||
- if tree.is_blob?
|
||||
= render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree }
|
||||
|
@ -42,12 +49,20 @@
|
|||
- else
|
||||
= simple_format(content.data)
|
||||
|
||||
- if params[:path]
|
||||
- history_path = tree_file_project_ref_path(@project, @ref, params[:path])
|
||||
- else
|
||||
- history_path = tree_project_ref_path(@project, @ref)
|
||||
:javascript
|
||||
$(function(){
|
||||
$('select#branch').selectmenu({style:'popup', width:200});
|
||||
$('select#tag').selectmenu({style:'popup', width:200});
|
||||
$('.project-refs-select').chosen();
|
||||
|
||||
history.pushState({ path: this.path }, '', "#{history_path}")
|
||||
});
|
||||
|
||||
|
||||
- if params[:path] && request.xhr?
|
||||
:javascript
|
||||
$(window).unbind('popstate');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue