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
Hide 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 {
padding
:
0
5px
0
5px
;
}
img
.centered
{
margin-left
:
auto
;
margin-right
:
auto
;
margin-top
:
3
0%
;
display
:
block
;
position
:
absolute
;
top
:
30%
;
left
:
5
0%
;
margin
:
0
0
0
-25%
;
}
#chatpanel
{
...
...
converse.js
View file @
01336fef
...
...
@@ -1038,24 +1038,39 @@
},
template
:
_
.
template
(
'
<div class="chat-head chat-head-chatroom">
'
+
'
<a class="close-chatbox-button">X</a>
'
+
'
<a class="configure-chatroom-button" style="display:none"> </a>
'
+
'
<div class="chat-title"> {{ name }} </div>
'
+
'
<p class="chatroom-topic"><p/>
'
+
'
</div>
'
+
'
<div class="chat-body">
'
+
'
<div class="chat-area">
'
+
'
<div class="chat-content"></div>
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
'
<textarea type="text" class="chat-textarea"
'
+
'
placeholder="Message"/>
'
+
'
</form>
'
+
'
</div>
'
+
'
<div class="participants">
'
+
'
<ul class="participant-list"></ul>
'
+
'
</div>
'
+
'
</div>
'
),
'
<div class="chat-head chat-head-chatroom">
'
+
'
<a class="close-chatbox-button">X</a>
'
+
'
<a class="configure-chatroom-button" style="display:none"> </a>
'
+
'
<div class="chat-title"> {{ name }} </div>
'
+
'
<p class="chatroom-topic"><p/>
'
+
'
</div>
'
+
'
<div class="chat-body">
'
+
'
<img class="spinner centered" src="images/spinner.gif"/>
'
+
'
</div>
'
),
chatarea_template
:
_
.
template
(
'
<div class="chat-area">
'
+
'
<div class="chat-content"></div>
'
+
'
<form class="sendXMPPMessage" action="" method="post">
'
+
'
<textarea type="text" class="chat-textarea"
'
+
'
placeholder="Message"/>
'
+
'
</form>
'
+
'
</div>
'
+
'
<div class="participants">
'
+
'
<ul class="participant-list"></ul>
'
+
'
</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
()
{
converse
.
connection
.
muc
.
join
(
...
...
@@ -1218,6 +1233,9 @@
},
onChatRoomPresence
:
function
(
presence
,
room
)
{
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
renderChatArea
();
}
var
nick
=
room
.
nick
,
$presence
=
$
(
presence
),
from
=
$presence
.
attr
(
'
from
'
),
$item
;
...
...
@@ -1371,6 +1389,9 @@
),
onChatRoomRoster
:
function
(
roster
,
room
)
{
if
(
!
this
.
$el
.
find
(
'
.chat-area
'
).
length
)
{
this
.
renderChatArea
();
}
var
controlboxview
=
converse
.
chatboxesview
.
views
.
controlbox
,
roster_size
=
_
.
size
(
roster
),
$participant_list
=
this
.
$el
.
find
(
'
.participant-list
'
),
...
...
@@ -1385,12 +1406,6 @@
}
$participant_list
.
append
(
participants
.
join
(
""
));
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