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
287663b2
Commit
287663b2
authored
Sep 09, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger autosize update after template selection
Closes #21982
parent
483a28a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/blob/template_selector.js
app/assets/javascripts/blob/template_selector.js
+7
-0
spec/features/projects/issuable_templates_spec.rb
spec/features/projects/issuable_templates_spec.rb
+13
-0
No files found.
CHANGELOG
View file @
287663b2
...
...
@@ -27,6 +27,7 @@ v 8.12.0 (unreleased)
- Fix bug where pagination is still displayed despite all todos marked as done (ClemMakesApps)
- Center build stage columns in pipeline overview (ClemMakesApps)
- Rename behaviour to behavior in bug issue template for consistency (ClemMakesApps)
- Fix bug stopping issue description being scrollable after selecting issue template
- Remove suggested colors hover underline (ClemMakesApps)
- Shorten task status phrase (ClemMakesApps)
- Fix project visibility level fields on settings
...
...
app/assets/javascripts/blob/template_selector.js
View file @
287663b2
...
...
@@ -13,6 +13,9 @@
this
.
buildDropdown
();
this
.
bindEvents
();
this
.
onFilenameUpdate
();
this
.
autosizeUpdateEvent
=
document
.
createEvent
(
'
Event
'
);
this
.
autosizeUpdateEvent
.
initEvent
(
'
autosize:update
'
,
true
,
false
);
}
TemplateSelector
.
prototype
.
buildDropdown
=
function
()
{
...
...
@@ -69,6 +72,10 @@
TemplateSelector
.
prototype
.
requestFileSuccess
=
function
(
file
,
skipFocus
)
{
this
.
editor
.
setValue
(
file
.
content
,
1
);
if
(
!
skipFocus
)
this
.
editor
.
focus
();
if
(
this
.
editor
instanceof
jQuery
)
{
this
.
editor
.
get
(
0
).
dispatchEvent
(
this
.
autosizeUpdateEvent
);
}
};
TemplateSelector
.
prototype
.
startLoadingSpinner
=
function
()
{
...
...
spec/features/projects/issuable_templates_spec.rb
View file @
287663b2
...
...
@@ -13,10 +13,12 @@ feature 'issuable templates', feature: true, js: true do
context
'user creates an issue using templates'
do
let
(
:template_content
)
{
'this is a test "bug" template'
}
let
(
:longtemplate_content
)
{
%Q(this
\n\n\n\n\n
is
\n\n\n\n\n
a
\n\n\n\n\n
bug
\n\n\n\n\n
template)
}
let
(
:issue
)
{
create
(
:issue
,
author:
user
,
assignee:
user
,
project:
project
)
}
background
do
project
.
repository
.
commit_file
(
user
,
'.gitlab/issue_templates/bug.md'
,
template_content
,
'added issue template'
,
'master'
,
false
)
project
.
repository
.
commit_file
(
user
,
'.gitlab/issue_templates/test.md'
,
longtemplate_content
,
'added issue template'
,
'master'
,
false
)
visit
edit_namespace_project_issue_path
project
.
namespace
,
project
,
issue
fill_in
:'issue[title]'
,
with:
'test issue title'
end
...
...
@@ -27,6 +29,17 @@ feature 'issuable templates', feature: true, js: true do
preview_template
save_changes
end
it
'updates height of markdown textarea'
do
start_height
=
page
.
evaluate_script
(
'$(".markdown-area").outerHeight()'
)
select_template
'test'
wait_for_ajax
end_height
=
page
.
evaluate_script
(
'$(".markdown-area").outerHeight()'
)
expect
(
end_height
).
not_to
eq
(
start_height
)
end
end
context
'user creates a merge request using templates'
do
...
...
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