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
539bd2db
Commit
539bd2db
authored
Aug 03, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some problems with rendering roster contacts
parent
4e7de9e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
22 deletions
+11
-22
converse.js
converse.js
+10
-19
src/templates/group_header.html
src/templates/group_header.html
+1
-3
No files found.
converse.js
View file @
539bd2db
...
...
@@ -3229,6 +3229,8 @@
});
this
.
RosterGroupView
=
Backbone
.
Overview
.
extend
({
tagName
:
'
dt
'
,
className
:
'
roster-group
'
,
events
:
{
"
click a.group-toggle
"
:
"
toggle
"
},
...
...
@@ -3238,7 +3240,7 @@
this
.
model
.
contacts
.
on
(
"
change:chat_status
"
,
function
(
contact
)
{
// This might be optimized by instead of first sorting, finding the correct position in positionContact
this
.
model
.
contacts
.
sort
();
this
.
positionContact
(
contact
);
this
.
positionContact
(
contact
)
.
render
()
;
},
this
);
this
.
model
.
contacts
.
on
(
"
destroy
"
,
this
.
onRemove
,
this
);
this
.
model
.
contacts
.
on
(
"
remove
"
,
this
.
onRemove
,
this
);
...
...
@@ -3246,7 +3248,8 @@
},
render
:
function
()
{
this
.
$el
.
replace
(
this
.
$el
.
data
(
'
group
'
,
this
.
model
.
get
(
'
name
'
));
this
.
$el
.
html
(
$
(
converse
.
templates
.
group_header
({
label_group
:
this
.
model
.
get
(
'
name
'
),
desc_group_toggle
:
this
.
model
.
get
(
'
description
'
),
...
...
@@ -3256,19 +3259,6 @@
return
this
;
},
_ensureElement
:
function
()
{
if
(
!
this
.
el
)
{
var
$el
=
$
(
converse
.
templates
.
group_header
({
label_group
:
this
.
model
.
get
(
'
name
'
),
desc_group_toggle
:
this
.
model
.
get
(
'
description
'
),
toggle_state
:
this
.
model
.
get
(
'
state
'
)
}));
this
.
setElement
(
$el
,
false
);
}
else
{
this
.
setElement
(
_
.
result
(
this
,
'
el
'
),
false
);
}
},
positionContact
:
function
(
contact
)
{
/* Place the contact's DOM element in the correct alphabetical
* position amongst the other contacts in this group.
...
...
@@ -3276,7 +3266,7 @@
var
view
=
this
.
get
(
contact
.
get
(
'
id
'
));
var
index
=
this
.
model
.
contacts
.
indexOf
(
contact
);
if
(
index
===
0
)
{
this
.
$el
.
after
(
view
.
render
().
el
);
this
.
$el
.
after
(
view
.
$
el
);
}
else
if
(
index
==
(
this
.
model
.
contacts
.
length
-
1
))
{
this
.
$el
.
nextUntil
(
'
dt
'
).
last
().
after
(
view
.
$el
);
}
else
{
...
...
@@ -3299,8 +3289,9 @@
},
addContact
:
function
(
contact
)
{
this
.
add
(
contact
.
get
(
'
id
'
),
new
converse
.
RosterContactView
({
model
:
contact
}));
this
.
positionContact
(
contact
);
var
view
=
new
converse
.
RosterContactView
({
model
:
contact
});
this
.
add
(
contact
.
get
(
'
id
'
),
view
);
this
.
positionContact
(
contact
).
render
();
this
.
$el
.
show
();
},
...
...
@@ -3425,7 +3416,7 @@
onGroupAdd
:
function
(
group
)
{
var
view
=
new
converse
.
RosterGroupView
({
model
:
group
});
this
.
add
(
group
.
get
(
'
name
'
),
view
);
this
.
add
(
group
.
get
(
'
name
'
),
view
.
render
()
);
this
.
positionGroup
(
view
);
},
...
...
src/templates/group_header.html
View file @
539bd2db
<dt
class=
"roster-group"
data-group=
"{{label_group}}"
>
<a
href=
"#"
class=
"group-toggle icon-{{toggle_state}}"
title=
"{{desc_group_toggle}}"
>
{{label_group}}
</a>
</dt>
<a
href=
"#"
class=
"group-toggle icon-{{toggle_state}}"
title=
"{{desc_group_toggle}}"
>
{{label_group}}
</a>
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