Skip to content
Snippets Groups Projects

Fix forward/back while browsing Tree hierarchy

Merged gitlab-qa-bot requested to merge github/fork/rspeicher/history_js into master

Created by: rspeicher

Adds History.js for better browser history while browsing the Tree.

Closes #1578 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 1 %ul.breadcrumb
2 2 %li
3 3 %span.arrow
4 = link_to project_tree_path(@project, @ref), remote: true do
  • Created by: dzaporozhets

    we write history and then trigger ajax call? Trying to understand how it works now :)

    By Administrator on 2012-10-10T08:28:48 (imported from GitLab project)

    By Administrator on 2012-10-10T08:28:48 (imported from GitLab)

  • gitlab-qa-bot
  • 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)

  • gitlab-qa-bot
  • 1 1 %ul.breadcrumb
    2 2 %li
    3 3 %span.arrow
    4 = link_to project_tree_path(@project, @ref), remote: true do
    • Created by: dzaporozhets

      ok. its clear now. Also i'm glad we got rid of @history_path. I'll merge it now - hope it works :)

      By Administrator on 2012-10-10T08:44:19 (imported from GitLab project)

      By Administrator on 2012-10-10T08:44:19 (imported from GitLab)

  • Created by: dzaporozhets

    Works good :)

    By Administrator on 2012-10-10T08:58:44 (imported from GitLab project)

    By Administrator on 2012-10-10T08:58:44 (imported from GitLab)

  • Please register or sign in to reply
    Loading