Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f91df171
Commit
f91df171
authored
Oct 17, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed find file keyboard navigation
Closes #23423
parent
77507df6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
app/assets/javascripts/project_find_file.js
app/assets/javascripts/project_find_file.js
+9
-0
spec/features/projects/files/find_file_keyboard_spec.rb
spec/features/projects/files/find_file_keyboard_spec.rb
+42
-0
No files found.
app/assets/javascripts/project_find_file.js
View file @
f91df171
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
function
ProjectFindFile
(
element1
,
options
)
{
function
ProjectFindFile
(
element1
,
options
)
{
this
.
element
=
element1
;
this
.
element
=
element1
;
this
.
options
=
options
;
this
.
options
=
options
;
this
.
goToBlob
=
bind
(
this
.
goToBlob
,
this
);
this
.
goToTree
=
bind
(
this
.
goToTree
,
this
);
this
.
goToTree
=
bind
(
this
.
goToTree
,
this
);
this
.
selectRowDown
=
bind
(
this
.
selectRowDown
,
this
);
this
.
selectRowDown
=
bind
(
this
.
selectRowDown
,
this
);
this
.
selectRowUp
=
bind
(
this
.
selectRowUp
,
this
);
this
.
selectRowUp
=
bind
(
this
.
selectRowUp
,
this
);
...
@@ -154,6 +155,14 @@
...
@@ -154,6 +155,14 @@
return
location
.
href
=
this
.
options
.
treeUrl
;
return
location
.
href
=
this
.
options
.
treeUrl
;
};
};
ProjectFindFile
.
prototype
.
goToBlob
=
function
()
{
var
$link
=
this
.
element
.
find
(
"
.tree-item.selected .tree-item-file-name a
"
);
if
(
$link
.
length
)
{
$link
.
get
(
0
).
click
();
}
};
return
ProjectFindFile
;
return
ProjectFindFile
;
})();
})();
...
...
spec/features/projects/files/find_file_keyboard_spec.rb
0 → 100644
View file @
f91df171
require
'spec_helper'
feature
'Find file keyboard shortcuts'
,
feature:
true
,
js:
true
do
include
WaitForAjax
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
user
visit
namespace_project_find_file_path
(
project
.
namespace
,
project
,
project
.
repository
.
root_ref
)
wait_for_ajax
end
it
'opens file when pressing enter key'
do
fill_in
'file_find'
,
with:
'CHANGELOG'
find
(
'#file_find'
).
native
.
send_keys
(
:enter
)
expect
(
page
).
to
have_selector
(
'.blob-content-holder'
)
page
.
within
(
'.file-title'
)
do
expect
(
page
).
to
have_content
(
'CHANGELOG'
)
end
end
it
'navigates files with arrow keys'
do
fill_in
'file_find'
,
with:
'application.'
find
(
'#file_find'
).
native
.
send_keys
(
:down
)
find
(
'#file_find'
).
native
.
send_keys
(
:enter
)
expect
(
page
).
to
have_selector
(
'.blob-content-holder'
)
page
.
within
(
'.file-title'
)
do
expect
(
page
).
to
have_content
(
'application.js'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment