Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
nexedi
converse.js
Commits
a9bb99a1
Commit
a9bb99a1
authored
Jul 08, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show animation when a message has been corrected
updates #421
parent
84a10d77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
dist/converse.js
dist/converse.js
+10
-1
src/converse-message-view.js
src/converse-message-view.js
+9
-1
No files found.
dist/converse.js
View file @
a9bb99a1
...
...
@@ -74587,7 +74587,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
initialize() {
this.model.vcard.on('change', this.render, this);
this.model.on('change:correcting', this.
render
, this);
this.model.on('change:correcting', this.
onMessageCorrection
, this);
this.model.on('change:message', this.render, this);
this.model.on('change:progress', this.renderFileUploadProgresBar, this);
this.model.on('change:type', this.render, this);
...
...
@@ -74617,6 +74617,15 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return this.el;
},
onMessageCorrection() {
this.render();
if (!this.model.get('correcting') && this.model.changed.message) {
this.el.addEventListener('animationend', () => u.removeClass('onload', this.el));
u.addClass('onload', this.el);
}
},
replaceElement(msg) {
if (!_.isNil(this.el.parentElement)) {
this.el.parentElement.replaceChild(msg, this.el);
src/converse-message-view.js
View file @
a9bb99a1
...
...
@@ -91,7 +91,7 @@
initialize
()
{
this
.
model
.
vcard
.
on
(
'
change
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:correcting
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:correcting
'
,
this
.
onMessageCorrection
,
this
);
this
.
model
.
on
(
'
change:message
'
,
this
.
render
,
this
);
this
.
model
.
on
(
'
change:progress
'
,
this
.
renderFileUploadProgresBar
,
this
);
this
.
model
.
on
(
'
change:type
'
,
this
.
render
,
this
);
...
...
@@ -118,6 +118,14 @@
return
this
.
el
;
},
onMessageCorrection
()
{
this
.
render
();
if
(
!
this
.
model
.
get
(
'
correcting
'
)
&&
this
.
model
.
changed
.
message
)
{
this
.
el
.
addEventListener
(
'
animationend
'
,
()
=>
u
.
removeClass
(
'
onload
'
,
this
.
el
));
u
.
addClass
(
'
onload
'
,
this
.
el
);
}
},
replaceElement
(
msg
)
{
if
(
!
_
.
isNil
(
this
.
el
.
parentElement
))
{
this
.
el
.
parentElement
.
replaceChild
(
msg
,
this
.
el
);
...
...
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