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
08c016da
Commit
08c016da
authored
Feb 19, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get ancestor element via selector
parent
658c2773
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
5 deletions
+13
-5
src/converse-muc.js
src/converse-muc.js
+2
-2
src/templates/bookmark.html
src/templates/bookmark.html
+1
-1
src/templates/room_item.html
src/templates/room_item.html
+1
-1
src/templates/rooms_list_item.html
src/templates/rooms_list_item.html
+1
-1
src/utils.js
src/utils.js
+8
-0
No files found.
src/converse-muc.js
View file @
08c016da
...
@@ -2756,7 +2756,7 @@
...
@@ -2756,7 +2756,7 @@
toggleRoomInfo
(
ev
)
{
toggleRoomInfo
(
ev
)
{
/* Show/hide extra information about a room in the listing.
/* Show/hide extra information about a room in the listing.
*/
*/
const
parent_el
=
ev
.
target
.
parentElement
.
parentElement
,
const
parent_el
=
u
.
ancestor
(
ev
.
target
,
'
.room-item
'
)
,
div_el
=
parent_el
.
querySelector
(
'
div.room-info
'
);
div_el
=
parent_el
.
querySelector
(
'
div.room-info
'
);
if
(
div_el
)
{
if
(
div_el
)
{
u
.
slideIn
(
div_el
).
then
(
u
.
removeElement
)
u
.
slideIn
(
div_el
).
then
(
u
.
removeElement
)
...
...
src/templates/bookmark.html
View file @
08c016da
<div>
<div
class=
"room-item"
>
<div
class=
"available-chatroom d-flex flex-row {[ if (o.hidden) { ]} hidden {[ } ]}"
data-room-jid=
"{{{o.jid}}}"
>
<div
class=
"available-chatroom d-flex flex-row {[ if (o.hidden) { ]} hidden {[ } ]}"
data-room-jid=
"{{{o.jid}}}"
>
<a
class=
"open-room w-100"
data-room-jid=
"{{{o.jid}}}"
title=
"{{{o.open_title}}}"
href=
"#"
>
{{{o.name}}}
</a>
<a
class=
"open-room w-100"
data-room-jid=
"{{{o.jid}}}"
title=
"{{{o.open_title}}}"
href=
"#"
>
{{{o.name}}}
</a>
<a
class=
"remove-bookmark fa fa-bookmark align-self-center {[ if (o.bookmarked) { ]} button-on {[ } ]}"
<a
class=
"remove-bookmark fa fa-bookmark align-self-center {[ if (o.bookmarked) { ]} button-on {[ } ]}"
...
...
src/templates/room_item.html
View file @
08c016da
<div>
<div
class=
"room-item"
>
<div
class=
"available-chatroom d-flex flex-row"
>
<div
class=
"available-chatroom d-flex flex-row"
>
<a
class=
"open-room available-room"
<a
class=
"open-room available-room"
data-room-jid=
"{{{o.jid}}}"
data-room-jid=
"{{{o.jid}}}"
...
...
src/templates/rooms_list_item.html
View file @
08c016da
<div>
<div
class=
"room-item"
>
<div
class=
"available-chatroom d-flex flex-row {[ if (o.num_unread_general) { ]} unread-msgs {[ } ]}"
data-room-jid=
"{{{o.jid}}}"
>
<div
class=
"available-chatroom d-flex flex-row {[ if (o.num_unread_general) { ]} unread-msgs {[ } ]}"
data-room-jid=
"{{{o.jid}}}"
>
{[ if (o.num_unread) { ]}
{[ if (o.num_unread) { ]}
<span
class=
"msgs-indicator"
>
{{{ o.num_unread }}}
</span>
<span
class=
"msgs-indicator"
>
{{{ o.num_unread }}}
</span>
...
...
src/utils.js
View file @
08c016da
...
@@ -148,6 +148,14 @@
...
@@ -148,6 +148,14 @@
return
el
;
return
el
;
}
}
u
.
ancestor
=
function
(
el
,
selector
)
{
let
parent
=
el
;
while
(
!
_
.
isNil
(
parent
)
&&
!
sizzle
.
matchesSelector
(
parent
,
selector
))
{
parent
=
parent
.
parentElement
;
}
return
parent
;
}
u
.
nextUntil
=
function
(
el
,
selector
,
include_self
=
false
)
{
u
.
nextUntil
=
function
(
el
,
selector
,
include_self
=
false
)
{
/* Return the element's siblings until one matches the selector. */
/* Return the element's siblings until one matches the selector. */
const
matches
=
[];
const
matches
=
[];
...
...
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