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
3b2b4ed6
Commit
3b2b4ed6
authored
Jul 17, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some improvements to scrolling.
parent
36306c74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
converse.js
converse.js
+22
-11
No files found.
converse.js
View file @
3b2b4ed6
...
...
@@ -1399,6 +1399,7 @@
fullname
=
this
.
model
.
get
(
'
fullname
'
)
||
msg_dict
.
fullname
,
extra_classes
=
msg_dict
.
delayed
&&
'
delayed
'
||
''
,
num_messages
=
this
.
model
.
messages
.
length
,
has_scrollbar
=
$content
.
get
(
0
).
scrollHeight
>
$content
[
0
].
clientHeight
,
template
,
username
,
insertMessage
;
// FIXME: A better approach here is probably to look at what is
...
...
@@ -1407,7 +1408,11 @@
// That way we could probably also better show day indicators.
// That code should perhaps go into onMessageAdded
if
(
num_messages
&&
msg_time
.
isBefore
(
this
.
model
.
messages
.
at
(
0
).
get
(
'
time
'
)))
{
insertMessage
=
$content
.
prepend
.
bind
(
$content
);
if
(
!
has_scrollbar
||
$content
.
scrollTop
()
!==
0
)
{
insertMessage
=
_
.
compose
(
this
.
scrollDown
.
bind
(
this
),
$content
.
prepend
.
bind
(
$content
));
}
else
{
insertMessage
=
$content
.
prepend
.
bind
(
$content
);
}
}
else
{
insertMessage
=
_
.
compose
(
this
.
scrollDown
.
bind
(
this
),
$content
.
append
.
bind
(
$content
));
}
...
...
@@ -1495,7 +1500,7 @@
converse
.
incrementMsgCounter
();
}
if
(
!
this
.
model
.
get
(
'
minimized
'
)
&&
!
this
.
$el
.
is
(
'
:visible
'
))
{
this
.
show
(
);
_
.
debounce
(
this
.
show
,
100
);
}
},
...
...
@@ -1959,15 +1964,21 @@
if
(
this
.
$el
.
is
(
'
:visible
'
)
&&
this
.
$el
.
css
(
'
opacity
'
)
==
"
1
"
)
{
return
this
.
focus
();
}
this
.
$el
.
fadeIn
(
callback
);
if
(
converse
.
connection
.
connected
)
{
// Without a connection, we haven't yet initialized
// localstorage
this
.
model
.
save
();
this
.
initDragResize
();
}
this
.
setChatState
(
ACTIVE
);
return
this
.
scrollDown
().
focus
();
this
.
$el
.
fadeIn
(
function
()
{
if
(
typeof
callback
==
"
function
"
)
{
callback
.
apply
(
this
,
arguments
);
}
if
(
converse
.
connection
.
connected
)
{
// Without a connection, we haven't yet initialized
// localstorage
this
.
model
.
save
();
this
.
initDragResize
();
}
this
.
setChatState
(
ACTIVE
);
this
.
scrollDown
().
focus
();
}.
bind
(
this
)
);
return
this
;
},
scrollDown
:
function
()
{
...
...
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