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
01336fef
Commit
01336fef
authored
May 13, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defer rendering of the messages area and roster
until after we are sure that the user has actually entered the room
parent
5f0a90d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
28 deletions
+43
-28
converse.css
converse.css
+4
-4
converse.js
converse.js
+39
-24
No files found.
converse.css
View file @
01336fef
...
@@ -17,10 +17,10 @@ img.spinner {
...
@@ -17,10 +17,10 @@ img.spinner {
padding
:
0
5px
0
5px
;
padding
:
0
5px
0
5px
;
}
}
img
.centered
{
img
.centered
{
margin-left
:
auto
;
position
:
absolute
;
margin-right
:
auto
;
top
:
30%
;
margin-top
:
3
0%
;
left
:
5
0%
;
display
:
block
;
margin
:
0
0
0
-25%
;
}
}
#chatpanel
{
#chatpanel
{
...
...
converse.js
View file @
01336fef
...
@@ -1045,6 +1045,10 @@
...
@@ -1045,6 +1045,10 @@
'
<p class="chatroom-topic"><p/>
'
+
'
<p class="chatroom-topic"><p/>
'
+
'
</div>
'
+
'
</div>
'
+
'
<div class="chat-body">
'
+
'
<div class="chat-body">
'
+
'
<img class="spinner centered" src="images/spinner.gif"/>
'
+
'
</div>
'
),
chatarea_template
:
_
.
template
(
'
<div class="chat-area">
'
+
'
<div class="chat-area">
'
+
'
<div class="chat-content"></div>
'
+
'
<div class="chat-content"></div>
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
...
@@ -1054,9 +1058,20 @@
...
@@ -1054,9 +1058,20 @@
'
</div>
'
+
'
</div>
'
+
'
<div class="participants">
'
+
'
<div class="participants">
'
+
'
<ul class="participant-list"></ul>
'
+
'
<ul class="participant-list"></ul>
'
+
'
</div>
'
+
'
</div>
'
),
'
</div>
'
),
render
:
function
()
{
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
.
html
(
this
.
template
(
this
.
model
.
toJSON
()));
return
this
;
},
renderChatArea
:
function
()
{
this
.
$el
.
find
(
'
img.spinner.centered
'
).
remove
();
this
.
$el
.
find
(
'
.chat-body
'
).
append
(
this
.
chatarea_template
());
return
this
;
},
initialize
:
function
()
{
initialize
:
function
()
{
converse
.
connection
.
muc
.
join
(
converse
.
connection
.
muc
.
join
(
this
.
model
.
get
(
'
jid
'
),
this
.
model
.
get
(
'
jid
'
),
...
@@ -1218,6 +1233,9 @@
...
@@ -1218,6 +1233,9 @@
},
},
onChatRoomPresence
:
function
(
presence
,
room
)
{
onChatRoomPresence
:
function
(
presence
,
room
)
{
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
renderChatArea
();
}
var
nick
=
room
.
nick
,
var
nick
=
room
.
nick
,
$presence
=
$
(
presence
),
$presence
=
$
(
presence
),
from
=
$presence
.
attr
(
'
from
'
),
$item
;
from
=
$presence
.
attr
(
'
from
'
),
$item
;
...
@@ -1371,6 +1389,9 @@
...
@@ -1371,6 +1389,9 @@
),
),
onChatRoomRoster
:
function
(
roster
,
room
)
{
onChatRoomRoster
:
function
(
roster
,
room
)
{
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
renderChatArea
();
}
var
controlboxview
=
converse
.
chatboxesview
.
views
.
controlbox
,
var
controlboxview
=
converse
.
chatboxesview
.
views
.
controlbox
,
roster_size
=
_
.
size
(
roster
),
roster_size
=
_
.
size
(
roster
),
$participant_list
=
this
.
$el
.
find
(
'
.participant-list
'
),
$participant_list
=
this
.
$el
.
find
(
'
.participant-list
'
),
...
@@ -1385,12 +1406,6 @@
...
@@ -1385,12 +1406,6 @@
}
}
$participant_list
.
append
(
participants
.
join
(
""
));
$participant_list
.
append
(
participants
.
join
(
""
));
return
true
;
return
true
;
},
render
:
function
()
{
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
.
html
(
this
.
template
(
this
.
model
.
toJSON
()));
return
this
;
}
}
});
});
...
...
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