feature - chat component on the right view
This commit is contained in:
20
index.php
20
index.php
@ -36,5 +36,25 @@
|
||||
<?php require_once('src/html/channel.php'); ?>
|
||||
<?php require_once('src/html/search.html'); ?>
|
||||
</main>
|
||||
|
||||
<sib-chat
|
||||
id="chat-singleton"
|
||||
data-authentication="login"
|
||||
data-auto-login="true"
|
||||
data-bosh-service-url="https://jabber.happy-dev.fr/http-bind/"
|
||||
data-debug="false"
|
||||
data-locales-url="en"
|
||||
bind-resources
|
||||
></sib-chat>
|
||||
|
||||
<script>
|
||||
window.addEventListener('navigate', event => {
|
||||
var chatSingleton = document.querySelector("#chat-singleton");
|
||||
var view = document.getElementById(event.detail.route);
|
||||
|
||||
view.querySelector(".chat-view").appendChild(chatSingleton);
|
||||
chatSingleton.dataset.src = view.dataset.src;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user