diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-29 14:14:55 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-29 14:14:55 +0400 |
commit | bfaa3edbf185ac1153cdda305246117c45ae622e (patch) | |
tree | c484698d36a91b76af3bf79668fbf10f01e0e714 /app | |
parent | ebf6821f54386d154cf250053b1007b61b1f9a27 (diff) |
Remove tree history & ajax slider
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/tree.js.coffee | 41 | ||||
-rw-r--r-- | app/views/tree/show.js.haml | 11 |
2 files changed, 7 insertions, 45 deletions
diff --git a/app/assets/javascripts/tree.js.coffee b/app/assets/javascripts/tree.js.coffee index 10d0df700e1..fdc82ff6668 100644 --- a/app/assets/javascripts/tree.js.coffee +++ b/app/assets/javascripts/tree.js.coffee @@ -1,40 +1,13 @@ # Code browser tree slider +# Make the entire tree-item row clickable, but not if clicking another link (like a commit message) +$(".tree-content-holder .tree-item").live 'click', (e) -> + if (e.target.nodeName != "A") + path = $('.tree-item-file-name a', this).attr('href') + Turbolinks.visit(path) $ -> - if $('#tree-slider').length > 0 - # Show the "Loading commit data" for only the first element - $('span.log_loading:first').removeClass('hide') - - $('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live "click", -> - $("#tree-content-holder").hide("slide", { direction: "left" }, 400) - - # Make the entire tree-item row clickable, but not if clicking another link (like a commit message) - $("#tree-slider .tree-item").live 'click', (e) -> - $('.tree-item-file-name a', this).trigger('click') if (e.target.nodeName != "A") - - # Maintain forward/back history while browsing the file tree - ((window) -> - History = window.History - $ = window.jQuery - document = window.document - - # Check to see if History.js is enabled for our Browser - unless History.enabled - return false - - $('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live 'click', (e) -> - History.pushState(null, null, decodeURIComponent($(@).attr('href'))) - return false - - History.Adapter.bind window, 'statechange', -> - state = History.getState() - $.ajax({ - url: state.url, - dataType: 'script', - beforeSend: -> $('.tree_progress').addClass("loading"), - complete: -> $('.tree_progress').removeClass("loading") - }) - )(window) + # Show the "Loading commit data" for only the first element + $('span.log_loading:first').removeClass('hide') # See if there are lines selected # "#L12" and "#L34-56" supported diff --git a/app/views/tree/show.js.haml b/app/views/tree/show.js.haml deleted file mode 100644 index 1e08688fb09..00000000000 --- a/app/views/tree/show.js.haml +++ /dev/null @@ -1,11 +0,0 @@ -:plain - // Load Files list - $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {tree: @tree}))}"); - $("#tree-content-holder").show("slide", { direction: "right" }, 400); - $('.project-refs-form #path').val("#{@path}"); - $(".project-refs-form #destination").val("tree"); - - // Load last commit log for each file in tree - $('#tree-slider').waitForImages(function() { - ajaxGet('#{@logs_path}'); - }); |