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
cf258f0b
Commit
cf258f0b
authored
Jun 10, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new public API method `converse.insertInto`
parent
9780024d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
CHANGES.md
CHANGES.md
+1
-0
Makefile
Makefile
+1
-1
src/converse-chatboxviews.js
src/converse-chatboxviews.js
+24
-0
No files found.
CHANGES.md
View file @
cf258f0b
...
...
@@ -43,6 +43,7 @@ Soon we'll deprecate the latter, so prepare now.
-
New config option
[
muc_hats_from_vcard
](
https://conversejs.org/docs/html/configuration.html#muc-hats-from-vcard
)
.
-
New config option
[
muc_send_probes
](
https://conversejs.org/docs/html/configuration.html#muc-send-probes
)
.
-
New config option
[
show_message_avatar
](
https://conversejs.org/docs/html/configuration.html#show-message-avatar
)
.
-
New public API
[
converse.insertInto
](
https://conversejs.org/docs/html/api/converse.html#.insertInto
)
## 6.0.0 (2020-01-09)
...
...
Makefile
View file @
cf258f0b
...
...
@@ -208,7 +208,7 @@ test:
## Documentation
./bin/activate
:
python3
.7
-m
venv .
python3
-m
venv .
.installed.cfg
:
requirements.txt buildout.cfg
./bin/pip
install
-r
requirements.txt
...
...
src/converse-chatboxviews.js
View file @
cf258f0b
...
...
@@ -154,5 +154,29 @@ converse.plugins.add('converse-chatboxviews', {
api
.
listen
.
on
(
'
chatBoxViewsInitialized
'
,
()
=>
calculateViewportHeightUnit
());
window
.
addEventListener
(
'
resize
'
,
()
=>
calculateViewportHeightUnit
());
/************************ END Event Handlers ************************/
Object
.
assign
(
converse
,
{
/**
* Public API method which will ensure that the #conversejs element
* is inserted into a container element.
*
* This method is useful when the #conversejs element has been
* detached from the DOM somehow.
* @async
* @memberOf converse
* @method insertInto
* @example
* converse.insertInto(document.querySelector('#converse-container'));
*/
insertInto
(
container
)
{
const
el
=
_converse
.
chatboxviews
?.
el
;
if
(
el
&&
!
container
.
contains
(
el
))
{
container
.
insertAdjacentElement
(
'
afterBegin
'
,
el
);
}
else
if
(
!
el
)
{
throw
new
Error
(
"
Cannot insert non-existing #conversejs element into the DOM
"
);
}
}
});
}
});
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