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
ce0096de
Commit
ce0096de
authored
Aug 03, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remember toggle state of group headers. updates #83
parent
1810e809
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
converse.js
converse.js
+2
-0
spec/controlbox.js
spec/controlbox.js
+31
-3
No files found.
converse.js
View file @
ce0096de
...
...
@@ -3286,9 +3286,11 @@
var
$el
=
$
(
ev
.
target
);
this
.
$el
.
nextUntil
(
'
dt
'
).
slideToggle
();
if
(
$el
.
hasClass
(
"
icon-opened
"
))
{
this
.
model
.
set
({
state
:
CLOSED
});
$el
.
removeClass
(
"
icon-opened
"
).
addClass
(
"
icon-closed
"
);
}
else
{
$el
.
removeClass
(
"
icon-closed
"
).
addClass
(
"
icon-opened
"
);
this
.
model
.
set
({
state
:
OPENED
});
}
},
...
...
spec/controlbox.js
View file @
ce0096de
...
...
@@ -124,7 +124,7 @@
describe
(
"
The Contacts Roster
"
,
$
.
proxy
(
function
(
mock
,
utils
)
{
describe
(
"
Roster Groups
"
,
$
.
proxy
(
function
()
{
describe
(
"
A Roster Group
"
,
$
.
proxy
(
function
()
{
beforeEach
(
function
()
{
converse
.
roster_groups
=
true
;
...
...
@@ -188,7 +188,7 @@
},
converse
));
},
converse
));
it
(
"
can share contacts
among them (values aren't distinct)
"
,
$
.
proxy
(
function
()
{
it
(
"
can share contacts
with other roster groups
"
,
$
.
proxy
(
function
()
{
_clearContacts
();
var
i
=
0
,
j
=
0
,
t
;
spyOn
(
converse
,
'
emit
'
);
...
...
@@ -213,8 +213,36 @@
expect
(
names
.
length
).
toEqual
(
mock
.
cur_names
.
length
);
},
converse
));
},
converse
));
},
converse
));
it
(
"
remembers whether it is closed or opened
"
,
$
.
proxy
(
function
()
{
var
i
=
0
,
j
=
0
,
t
;
var
groups
=
{
'
colleagues
'
:
3
,
'
friends & acquaintences
'
:
3
,
'
Ungrouped
'
:
2
};
_
.
each
(
_
.
keys
(
groups
),
$
.
proxy
(
function
(
name
)
{
j
=
i
;
for
(
i
=
j
;
i
<
j
+
groups
[
name
];
i
++
)
{
this
.
rosterview
.
roster
.
create
({
jid
:
mock
.
cur_names
[
i
].
replace
(
/ /g
,
'
.
'
).
toLowerCase
()
+
'
@localhost
'
,
subscription
:
'
both
'
,
ask
:
null
,
groups
:
name
===
'
ungrouped
'
?
[]
:
[
name
],
fullname
:
mock
.
cur_names
[
i
],
is_last
:
i
===
(
mock
.
cur_names
.
length
-
1
)
});
}
},
converse
));
var
view
=
this
.
rosterview
.
get
(
'
colleagues
'
);
var
$toggle
=
view
.
$el
.
find
(
'
a.group-toggle
'
);
expect
(
view
.
model
.
get
(
'
state
'
)).
toBe
(
'
opened
'
);
$toggle
.
click
();
expect
(
view
.
model
.
get
(
'
state
'
)).
toBe
(
'
closed
'
);
$toggle
.
click
();
expect
(
view
.
model
.
get
(
'
state
'
)).
toBe
(
'
opened
'
);
},
converse
));
},
converse
));
describe
(
"
Pending Contacts
"
,
$
.
proxy
(
function
()
{
function
_clearContacts
()
{
...
...
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