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
f3373c44
Commit
f3373c44
authored
Apr 21, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #850. `.where` method doesn't match numbers.
parent
1936e282
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
spec/controlbox.js
spec/controlbox.js
+2
-2
src/converse-core.js
src/converse-core.js
+4
-3
src/converse-rosterview.js
src/converse-rosterview.js
+8
-8
No files found.
spec/controlbox.js
View file @
f3373c44
...
...
@@ -151,7 +151,7 @@
}).
then
(
function
(
contacts
)
{
expect
(
$roster
.
find
(
'
dd:visible
'
).
eq
(
0
).
text
().
trim
()).
toBe
(
'
Candice van der Knijff
'
);
expect
(
$roster
.
find
(
'
dt:visible
'
).
length
).
toBe
(
1
);
expect
(
$roster
.
find
(
'
dt:visible
'
).
eq
(
0
).
text
(
)).
toBe
(
'
colleagues
'
);
expect
(
_
.
trim
(
$roster
.
find
(
'
dt:visible
'
).
eq
(
0
).
text
()
)).
toBe
(
'
colleagues
'
);
$filter
=
_converse
.
rosterview
.
$
(
'
.roster-filter
'
);
$filter
.
val
(
"
an
"
);
$filter
.
trigger
(
'
keydown
'
);
...
...
@@ -204,7 +204,7 @@
return
$roster
.
find
(
'
dt:visible
'
).
length
===
1
;
},
500
);
}).
then
(
function
()
{
expect
(
$roster
.
find
(
'
dt:visible
'
).
eq
(
0
).
text
(
)).
toBe
(
'
colleagues
'
);
expect
(
_
.
trim
(
$roster
.
find
(
'
dt:visible
'
).
eq
(
0
).
text
()
)).
toBe
(
'
colleagues
'
);
expect
(
$roster
.
find
(
'
dd:visible
'
).
length
).
toBe
(
3
);
// Check that all contacts under the group are shown
expect
(
$roster
.
find
(
'
dt:visible
'
).
nextUntil
(
'
dt
'
,
'
dd:hidden
'
).
length
).
toBe
(
0
);
...
...
src/converse-core.js
View file @
f3373c44
...
...
@@ -1146,10 +1146,11 @@
/* Get the roster from the XMPP server */
var
iq
=
$iq
({
type
:
'
get
'
,
'
id
'
:
_converse
.
connection
.
getUniqueId
(
'
roster
'
)})
.
c
(
'
query
'
,
{
xmlns
:
Strophe
.
NS
.
ROSTER
});
var
that
=
this
;
return
_converse
.
connection
.
sendIQ
(
iq
,
function
()
{
this
.
onReceivedFromServer
.
apply
(
this
,
arguments
);
callback
.
apply
(
this
,
arguments
);
}.
bind
(
this
)
);
that
.
onReceivedFromServer
.
apply
(
that
,
arguments
);
callback
.
apply
(
that
,
arguments
);
}
);
},
onReceivedFromServer
:
function
(
iq
)
{
...
...
src/converse-rosterview.js
View file @
f3373c44
...
...
@@ -32,6 +32,7 @@
b64_sha1
=
converse
.
env
.
b64_sha1
,
_
=
converse
.
env
.
_
;
converse
.
plugins
.
add
(
'
converse-rosterview
'
,
{
overrides
:
{
...
...
@@ -643,7 +644,7 @@
// would simplify things by not having to check whether the
// group is collapsed or not.
var
name
=
this
.
$el
.
prevAll
(
'
dt:first
'
).
data
(
'
group
'
);
var
group
=
_
converse
.
rosterview
.
model
.
where
({
'
name
'
:
name
})[
0
]
;
var
group
=
_
.
head
(
_converse
.
rosterview
.
model
.
where
({
'
name
'
:
name
.
toString
()}))
;
if
(
group
.
get
(
'
state
'
)
===
_converse
.
CLOSED
)
{
return
true
;
}
...
...
@@ -742,13 +743,12 @@
render
:
function
()
{
this
.
el
.
setAttribute
(
'
data-group
'
,
this
.
model
.
get
(
'
name
'
));
this
.
$el
.
html
(
$
(
tpl_group_header
({
label_group
:
this
.
model
.
get
(
'
name
'
),
desc_group_toggle
:
this
.
model
.
get
(
'
description
'
),
toggle_state
:
this
.
model
.
get
(
'
state
'
)
}))
);
var
html
=
tpl_group_header
({
label_group
:
this
.
model
.
get
(
'
name
'
),
desc_group_toggle
:
this
.
model
.
get
(
'
description
'
),
toggle_state
:
this
.
model
.
get
(
'
state
'
)
});
this
.
el
.
innerHTML
=
html
;
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