Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
39d70f37
Commit
39d70f37
authored
6 years ago
by
ThibG
Committed by
Eugen Rochko
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove unneeded code now that attachment URL isn't appended to toots (#7593)
parent
1a564df5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/javascript/mastodon/features/compose/components/compose_form.js
+1
-11
1 addition, 11 deletions
...ript/mastodon/features/compose/components/compose_form.js
with
1 addition
and
11 deletions
app/javascript/mastodon/features/compose/components/compose_form.js
+
1
−
11
View file @
39d70f37
...
...
@@ -104,23 +104,13 @@ export default class ComposeForm extends ImmutablePureComponent {
this
.
props
.
onChangeSpoilerText
(
e
.
target
.
value
);
}
componentWillReceiveProps
(
nextProps
)
{
// If this is the update where we've finished uploading,
// save the last caret position so we can restore it below!
if
(
!
nextProps
.
is_uploading
&&
this
.
props
.
is_uploading
)
{
this
.
_restoreCaret
=
this
.
autosuggestTextarea
.
textarea
.
selectionStart
;
}
}
componentDidUpdate
(
prevProps
)
{
// This statement does several things:
// - If we're beginning a reply, and,
// - Replying to zero or one users, places the cursor at the end of the textbox.
// - Replying to more than one user, selects any usernames past the first;
// this provides a convenient shortcut to drop everyone else from the conversation.
// - If we've just finished uploading an image, and have a saved caret position,
// restores the cursor to that position after the text changes!
if
(
this
.
props
.
focusDate
!==
prevProps
.
focusDate
||
(
prevProps
.
is_uploading
&&
!
this
.
props
.
is_uploading
&&
typeof
this
.
_restoreCaret
===
'
number
'
))
{
if
(
this
.
props
.
focusDate
!==
prevProps
.
focusDate
)
{
let
selectionEnd
,
selectionStart
;
if
(
this
.
props
.
preselectDate
!==
prevProps
.
preselectDate
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment