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
Tatuya Kamada
gitlab-ce
Commits
dd6f91cd
Commit
dd6f91cd
authored
Jan 19, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger autosize on the textarea after pasting
parent
b6ac5332
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
app/assets/javascripts/lib/utils/common_utils.js.es6
app/assets/javascripts/lib/utils/common_utils.js.es6
+8
-0
app/assets/javascripts/shortcuts_issuable.js
app/assets/javascripts/shortcuts_issuable.js
+8
-1
No files found.
app/assets/javascripts/lib/utils/common_utils.js.es6
View file @
dd6f91cd
...
@@ -185,6 +185,14 @@
...
@@ -185,6 +185,14 @@
target.value = newText;
target.value = newText;
target.selectionStart = target.selectionEnd = selectionStart + text.length;
target.selectionStart = target.selectionEnd = selectionStart + text.length;
// Trigger autosave
$(target).trigger('input');
// Trigger autosize
var event = document.createEvent('Event');
event.initEvent('autosize:update', true, false);
target.dispatchEvent(event);
};
};
w.gl.utils.nodeMatchesSelector = (node, selector) => {
w.gl.utils.nodeMatchesSelector = (node, selector) => {
...
...
app/assets/javascripts/shortcuts_issuable.js
View file @
dd6f91cd
...
@@ -61,8 +61,15 @@
...
@@ -61,8 +61,15 @@
replyField
.
val
(
function
(
_
,
current
)
{
replyField
.
val
(
function
(
_
,
current
)
{
return
current
+
separator
+
quote
.
join
(
''
)
+
"
\n
"
;
return
current
+
separator
+
quote
.
join
(
''
)
+
"
\n
"
;
});
});
// Trigger autosave for the added text
// Trigger autosave
replyField
.
trigger
(
'
input
'
);
replyField
.
trigger
(
'
input
'
);
// Trigger autosize
var
event
=
document
.
createEvent
(
'
Event
'
);
event
.
initEvent
(
'
autosize:update
'
,
true
,
false
);
replyField
.
get
(
0
).
dispatchEvent
(
event
);
// Focus the input field
// Focus the input field
return
replyField
.
focus
();
return
replyField
.
focus
();
};
};
...
...
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