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
73fd3d6a
Commit
73fd3d6a
authored
Jun 12, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fade out ephemeral messages
parent
91882e2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
16 deletions
+27
-16
sass/_core.scss
sass/_core.scss
+10
-13
src/converse-chatboxviews.js
src/converse-chatboxviews.js
+2
-1
src/converse-message-view.js
src/converse-message-view.js
+15
-2
No files found.
sass/_core.scss
View file @
73fd3d6a
...
@@ -385,8 +385,6 @@ body.converse-fullscreen {
...
@@ -385,8 +385,6 @@ body.converse-fullscreen {
75
%
{
background-color
:
rgba
(
255
,
181
,
162
,
0
.25
);}
75
%
{
background-color
:
rgba
(
255
,
181
,
162
,
0
.25
);}
100
%
{
background-color
:
transparent
;}
100
%
{
background-color
:
transparent
;}
}
}
@keyframes
fadein
{
@keyframes
fadein
{
0
%
{
opacity
:
0
}
0
%
{
opacity
:
0
}
100
%
{
opacity
:
1
}
100
%
{
opacity
:
1
}
...
@@ -395,15 +393,14 @@ body.converse-fullscreen {
...
@@ -395,15 +393,14 @@ body.converse-fullscreen {
0
%
{
opacity
:
0
}
0
%
{
opacity
:
0
}
100
%
{
opacity
:
1
}
100
%
{
opacity
:
1
}
}
}
@-webkit-keyframes
fadeOut
{
@-webkit-keyframes
fadeOut
{
0
%
{
opacity
:
1
;
visibility
:
visible
;
}
0
%
{
opacity
:
1
;
visibility
:
visible
;
}
100
%
{
opacity
:
0
;
visibility
:
hidden
;
}
100
%
{
opacity
:
0
;
visibility
:
hidden
;
}
}
}
@keyframes
fadeOut
{
@keyframes
fadeOut
{
0
%
{
opacity
:
1
;
visibility
:
visible
;
}
0
%
{
opacity
:
1
;
visibility
:
visible
;
}
100
%
{
opacity
:
0
;
visibility
:
hidden
;
}
100
%
{
opacity
:
0
;
visibility
:
hidden
;
}
}
}
.fade-in
{
.fade-in
{
@include
fade-in
;
@include
fade-in
;
...
@@ -423,10 +420,10 @@ body.converse-fullscreen {
...
@@ -423,10 +420,10 @@ body.converse-fullscreen {
}
}
.fade-out
{
.fade-out
{
animation-duration
:
1
s
;
animation-duration
:
0
.5
s
;
animation-fill-mode
:
forwards
;
animation-fill-mode
:
forwards
;
animation-name
:
fadeOut
;
animation-name
:
fadeOut
;
animation-timing-function
:
ease-in-out
;
animation-timing-function
:
ease-in-out
;
}
}
.collapsed
{
.collapsed
{
...
...
src/converse-chatboxviews.js
View file @
73fd3d6a
...
@@ -72,7 +72,8 @@ converse.plugins.add('converse-chatboxviews', {
...
@@ -72,7 +72,8 @@ converse.plugins.add('converse-chatboxviews', {
// Refer to docs/source/configuration.rst for explanations of these
// Refer to docs/source/configuration.rst for explanations of these
// configuration settings.
// configuration settings.
_converse
.
api
.
settings
.
update
({
_converse
.
api
.
settings
.
update
({
'
theme
'
:
'
default
'
,
'
animate
'
:
true
,
'
theme
'
:
'
default
'
});
});
_converse
.
ViewWithAvatar
=
Backbone
.
NativeView
.
extend
(
AvatarMixin
);
_converse
.
ViewWithAvatar
=
Backbone
.
NativeView
.
extend
(
AvatarMixin
);
...
...
src/converse-message-view.js
View file @
73fd3d6a
...
@@ -97,7 +97,7 @@ converse.plugins.add('converse-message-view', {
...
@@ -97,7 +97,7 @@ converse.plugins.add('converse-message-view', {
this
.
debouncedRender
();
this
.
debouncedRender
();
});
});
this
.
model
.
on
(
'
change
'
,
this
.
onChanged
,
this
);
this
.
model
.
on
(
'
change
'
,
this
.
onChanged
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
remove
,
this
);
this
.
model
.
on
(
'
destroy
'
,
this
.
fadeOut
,
this
);
},
},
async
render
()
{
async
render
()
{
...
@@ -140,11 +140,24 @@ converse.plugins.add('converse-message-view', {
...
@@ -140,11 +140,24 @@ converse.plugins.add('converse-message-view', {
}
}
},
},
fadeOut
()
{
if
(
_converse
.
animate
)
{
this
.
el
.
addEventListener
(
'
animationend
'
,
()
=>
this
.
remove
(),
{
'
once
'
:
true
});
u
.
addClass
(
'
fade-out
'
,
this
.
el
);
}
else
{
this
.
remove
();
}
},
onMessageEdited
()
{
onMessageEdited
()
{
if
(
this
.
model
.
get
(
'
is_archived
'
))
{
if
(
this
.
model
.
get
(
'
is_archived
'
))
{
return
;
return
;
}
}
this
.
el
.
addEventListener
(
'
animationend
'
,
()
=>
u
.
removeClass
(
'
onload
'
,
this
.
el
));
this
.
el
.
addEventListener
(
'
animationend
'
,
()
=>
u
.
removeClass
(
'
onload
'
,
this
.
el
),
{
'
once
'
:
true
}
);
u
.
addClass
(
'
onload
'
,
this
.
el
);
u
.
addClass
(
'
onload
'
,
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