Skip to content

Commit

Permalink
Merge branch 'secret-shortcut-feature' into 'master'
Browse files Browse the repository at this point in the history
Adds "t" as a shortcut for find file anywhere



See merge request !2507
  • Loading branch information
dzaporozhets committed Jan 20, 2016
2 parents 41c5c39 + 7377abf commit 5ad60c5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/dispatcher.js.coffee
Expand Up @@ -87,7 +87,6 @@ class Dispatcher
new GroupAvatar()
when 'projects:tree:show'
new TreeView()
shortcut_handler = new ShortcutsTree()
when 'projects:find_file:show'
shortcut_handler = true
when 'projects:blob:show'
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/shortcuts.js.coffee
Expand Up @@ -4,6 +4,7 @@ class @Shortcuts
Mousetrap.reset()
Mousetrap.bind('?', @selectiveHelp)
Mousetrap.bind('s', Shortcuts.focusSearch)
Mousetrap.bind('t', -> Turbolinks.visit(findFileURL)) if findFileURL?

selectiveHelp: (e) =>
Shortcuts.showHelp(e, @enabledHelp)
Expand Down
4 changes: 0 additions & 4 deletions app/assets/javascripts/shortcuts_tree.coffee

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/layouts/header/_default.html.haml
Expand Up @@ -37,3 +37,6 @@
%h1.title= title
= render 'shared/outdated_browser'
- if @project && !@project.empty_repo?
:javascript
var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, @ref || @project.repository.root_ref)}";
2 changes: 1 addition & 1 deletion app/views/projects/find_file/show.html.haml
Expand Up @@ -10,7 +10,7 @@
= link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
= @project.path
%li.file-finder
%input#file_find.form-control.file-finder-input{type: "text", placeholder: 'Find by path'}
%input#file_find.form-control.file-finder-input{type: "text", placeholder: 'Find by path', autocomplete: 'off'}

%div.tree-content-holder
.table-holder
Expand Down
2 changes: 1 addition & 1 deletion features/steps/project/merge_requests.rb
Expand Up @@ -41,7 +41,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end

step 'I should not see "master" branch' do
expect(page).not_to have_content "master"
expect(find('.merge-request-info')).not_to have_content "master"
end

step 'I should see "other_branch" branch' do
Expand Down

0 comments on commit 5ad60c5

Please sign in to comment.