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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1536109c
Commit
1536109c
authored
Feb 09, 2017
by
Sam Rose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retrigger at.js for slash commands with autocomplete suffix
parent
5e952962
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
app/assets/javascripts/gfm_auto_complete.js.es6
app/assets/javascripts/gfm_auto_complete.js.es6
+3
-0
changelogs/unreleased/27883-autocomplete-seems-to-not-trigger-when-at-character-is-part-of-an-autocompleted-text.yml
...er-when-at-character-is-part-of-an-autocompleted-text.yml
+4
-0
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+14
-0
No files found.
app/assets/javascripts/gfm_auto_complete.js.es6
View file @
1536109c
...
...
@@ -103,6 +103,9 @@
this.input.each((i, input) => {
const $input = $(input);
$input.off('focus.setupAtWho').on('focus.setupAtWho', this.setupAtWho.bind(this, $input));
// This triggers at.js again
// Needed for slash commands with suffixes (ex: /label ~)
$input.on('inserted-commands.atwho', $input.trigger.bind($input, 'keyup'));
});
},
setupAtWho: function($input) {
...
...
changelogs/unreleased/27883-autocomplete-seems-to-not-trigger-when-at-character-is-part-of-an-autocompleted-text.yml
0 → 100644
View file @
1536109c
---
title
:
Trigger autocomplete after selecting a slash command
merge_request
:
9117
author
:
spec/features/issues/gfm_autocomplete_spec.rb
View file @
1536109c
...
...
@@ -182,6 +182,20 @@ feature 'GFM autocomplete', feature: true, js: true do
expect
(
page
).
not_to
have_selector
(
'.atwho-view'
)
end
it
'triggers autocomplete after selecting a slash command'
do
note
=
find
(
'#note_note'
)
page
.
within
'.timeline-content-form'
do
note
.
native
.
send_keys
(
''
)
note
.
native
.
send_keys
(
'/as'
)
note
.
click
end
find
(
'.atwho-view li'
,
text:
'/assign'
).
native
.
send_keys
(
:tab
)
user_item
=
find
(
'.atwho-view li'
,
text:
user
.
username
)
expect
(
user_item
).
to
have_content
(
user
.
username
)
end
def
expect_to_wrap
(
should_wrap
,
item
,
note
,
value
)
expect
(
item
).
to
have_content
(
value
)
expect
(
item
).
not_to
have_content
(
"
\"
#{
value
}
\"
"
)
...
...
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