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
d5ed1bfa
Commit
d5ed1bfa
authored
Aug 02, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the coupling between converse-controlbox and converse-rosterview
parent
0b430823
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
src/converse-controlbox.js
src/converse-controlbox.js
+0
-15
src/converse-rosterview.js
src/converse-rosterview.js
+16
-0
No files found.
src/converse-controlbox.js
View file @
d5ed1bfa
...
...
@@ -9,7 +9,6 @@
*/
import
"
converse-chatview
"
;
import
"
converse-profile
"
;
import
"
converse-rosterview
"
;
import
_FormData
from
"
formdata-polyfill
"
;
import
bootstrap
from
"
bootstrap.native
"
;
import
converse
from
"
@converse/headless/converse-core
"
;
...
...
@@ -197,9 +196,6 @@ converse.plugins.add('converse-controlbox', {
this
.
model
.
on
(
'
show
'
,
this
.
show
,
this
);
this
.
model
.
on
(
'
change:closed
'
,
this
.
ensureClosedState
,
this
);
this
.
render
();
if
(
this
.
model
.
get
(
'
connected
'
))
{
this
.
insertRoster
();
}
/**
* Triggered when the _converse.ControlBoxView has been initialized and therefore
* exists. The controlbox contains the login and register forms when the user is
...
...
@@ -238,18 +234,7 @@ converse.plugins.add('converse-controlbox', {
onConnected
()
{
if
(
this
.
model
.
get
(
'
connected
'
))
{
this
.
render
();
this
.
insertRoster
();
}
},
insertRoster
()
{
if
(
_converse
.
authentication
===
_converse
.
ANONYMOUS
)
{
return
;
}
/* Place the rosterview inside the "Contacts" panel. */
_converse
.
api
.
waitUntil
(
'
rosterViewInitialized
'
)
.
then
(()
=>
this
.
controlbox_pane
.
el
.
insertAdjacentElement
(
'
beforeEnd
'
,
_converse
.
rosterview
.
el
))
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
},
createBrandHeadingHTML
()
{
...
...
src/converse-rosterview.js
View file @
d5ed1bfa
...
...
@@ -951,6 +951,22 @@ converse.plugins.add('converse-rosterview', {
_converse
.
chatboxes
.
on
(
'
change:hidden
'
,
chatbox
=>
highlightRosterItem
(
chatbox
));
});
_converse
.
api
.
listen
.
on
(
'
controlboxInitialized
'
,
(
view
)
=>
{
function
insertRoster
()
{
if
(
!
view
.
model
.
get
(
'
connected
'
)
||
_converse
.
authentication
===
_converse
.
ANONYMOUS
)
{
return
;
}
/* Place the rosterview inside the "Contacts" panel. */
_converse
.
api
.
waitUntil
(
'
rosterViewInitialized
'
)
.
then
(()
=>
view
.
controlbox_pane
.
el
.
insertAdjacentElement
(
'
beforeEnd
'
,
_converse
.
rosterview
.
el
))
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
}
insertRoster
();
view
.
model
.
on
(
'
change:connected
'
,
insertRoster
);
});
function
initRoster
()
{
/* Create an instance of RosterView once the RosterGroups
* collection has been created (in @converse/headless/converse-core.js)
...
...
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