Fix forward/back while browsing Tree hierarchy
Created by: rspeicher
Adds History.js for better browser history while browsing the Tree.
Closes #1578 (closed)
Merge request reports
Activity
1 1 %ul.breadcrumb 2 2 %li 3 3 %span.arrow 4 = link_to project_tree_path(@project, @ref), remote: true do 1 1 %ul.breadcrumb 2 2 %li 3 3 %span.arrow 4 = link_to project_tree_path(@project, @ref), remote: true do Created by: rspeicher
Yeah it's slightly confusing. The links are no longer remote; the new JS code captures the click, pushes the history state and returns false so the click doesn't go through. Then because of the History change,
statechange
is called and we fetch the last URL via Ajax and update the page.Otherwise the unobtrusive Rails JS would handle the remote link via AJAX, but then so would the History event, so it was loading twice.
By Administrator on 2012-10-10T08:30:59 (imported from GitLab project)
By Administrator on 2012-10-10T08:30:59 (imported from GitLab)
1 1 %ul.breadcrumb 2 2 %li 3 3 %span.arrow 4 = link_to project_tree_path(@project, @ref), remote: true do