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
e49fbc45
Commit
e49fbc45
authored
May 15, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bookmarks: Don't duplicate bookmarks in list.
parent
3343cb69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
spec/bookmarks.js
spec/bookmarks.js
+1
-1
src/converse-bookmarks.js
src/converse-bookmarks.js
+15
-1
No files found.
spec/bookmarks.js
View file @
e49fbc45
...
...
@@ -405,7 +405,7 @@
.
c
(
'
conference
'
,
{
'
name
'
:
'
Bookmark with a very very long name that will be shortened
'
,
'
autojoin
'
:
'
false
'
,
'
jid
'
:
'
theplay
@conference.shakespeare.lit
'
'
jid
'
:
'
longname
@conference.shakespeare.lit
'
}).
c
(
'
nick
'
).
t
(
'
JC
'
).
up
().
up
()
.
c
(
'
conference
'
,
{
'
name
'
:
'
Another room
'
,
...
...
src/converse-bookmarks.js
View file @
e49fbc45
...
...
@@ -404,14 +404,20 @@
if
(
item
instanceof
_converse
.
ChatBox
)
{
item
=
_
.
head
(
this
.
model
.
where
({
'
jid
'
:
item
.
get
(
'
jid
'
)}));
if
(
_
.
isNil
(
item
))
{
// A chat box has been closed, but we don't have a
// bookmark for it, so nothing further to do here.
return
;
}
}
if
(
_converse
.
hide_open_bookmarks
&&
_converse
.
chatboxes
.
where
({
'
jid
'
:
item
.
get
(
'
jid
'
)}).
length
)
{
// A chat box has been opened, and we don't show
// bookmarks for open chats, so we remove it.
this
.
removeBookmarkListElement
(
item
);
return
;
}
var
list_el
=
this
.
el
.
querySelector
(
'
.bookmarks
'
);
var
div
=
document
.
createElement
(
'
div
'
);
div
.
innerHTML
=
tpl_bookmark
({
'
bookmarked
'
:
true
,
...
...
@@ -424,7 +430,15 @@
'
name
'
:
item
.
get
(
'
name
'
),
'
open_title
'
:
__
(
'
Click to open this room
'
)
});
this
.
el
.
querySelector
(
'
.bookmarks
'
).
appendChild
(
div
.
firstChild
);
var
el
=
_
.
head
(
sizzle
(
'
.available-chatroom[data-room-jid="
'
+
item
.
get
(
'
jid
'
)
+
'
"]
'
,
list_el
));
if
(
el
)
{
el
.
innerHTML
=
div
.
firstChild
.
innerHTML
;
}
else
{
list_el
.
appendChild
(
div
.
firstChild
);
}
this
.
show
();
},
...
...
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