Rocket.chat: Navbar showing when use iframe "go" command and embedded layout

Created on 13 Oct 2018  路  6Comments  路  Source: RocketChat/Rocket.Chat

Description:

When switching rooms inside the IFRAME through the "Go" command (https://rocket.chat/docs/developer-guides/iframe-integration/commands/) - the top panel appears

Steps to reproduce:

  1. Embed chat in iframe with layout = embedded
  2. Give the command "go" to IFRAME (https://rocket.chat/docs/developer-guides/iframe-integration/commands/) to go to another chat inside the IFRAME (in path specify the path to the new room and pass the "?layout=embedded" parameter)
  3. In the new room we see the display of top NavBar
  4. If you go to the room that was opened first, the panel is not displayed

Expected behavior:

No NavBar:
image

Actual behavior:

Presence of NavBar:

image

Server Setup Information:

  • Version of Rocket.Chat Server: 0.70.4
  • Operating System: windows
  • Deployment Method: docker
  • Number of Running Instances: 1
challenge easy uux

Most helpful comment

We found a temporary solution, we add in Admin Panel -> Layout -> 'Custom Script for Logged In Users' section this code

window.RocketChat.Layout.layout = 'embedded';

For this way, you can set the layout var and the embedded mode will be active

All 6 comments

hey @sdelfi I'm quite sure our 0.70.x versions are working different... could you test this version and tell me if its working as you expect?

image

Hi, @ggazzo
I did not quite understand your question. I have now 0.70.4 and tested on this version.

image

Or asked for something else?

I recorded a video (gif) with a problem I described: https://i.imgur.com/lNUvBxA.gif

In the left section - iframe chat window.
On the right are chat list buttons. I do switching through iframe API:

iframe_obj.get(0).contentWindow.postMessage({
    externalCommand: 'go',
    path: relative_url
}, '*')

I have noticed that this was probably because of the variable embeddedVersion variable not being set correctly when using the go command to switch channels.

From what I can see, in some places it's basically equal to RocketChat.Layout.isEmbedded(), and in one place, it equals to embedded-view if RocketChat.Layout.isEmbedded() equals to true (is the different behavior for the same variable name on purpose?).

As a workaround, I had to resort to patching the code manually where that variable was accessed or used and either remove a chunk of html or force its value to embedded-view to make things work. I hope this helps someone working on this issue.

My version: 0.72.3

Same here, when I use "go" command and ?layout=embedded the iframe is showing the menu.

Tested in version 0.73.2

We found a temporary solution, we add in Admin Panel -> Layout -> 'Custom Script for Logged In Users' section this code

window.RocketChat.Layout.layout = 'embedded';

For this way, you can set the layout var and the embedded mode will be active

We found a temporary solution, we add in Admin Panel -> Layout -> 'Custom Script for Logged In Users' section this code

window.RocketChat.Layout.layout = 'embedded';

For this way, you can set the layout var and the embedded mode will be active

Worked for me,this is what I was looking for!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mddvul22 picture mddvul22  路  3Comments

neha1deshmukh picture neha1deshmukh  路  3Comments

djeber picture djeber  路  3Comments

tanc picture tanc  路  3Comments

Kiran-Rao picture Kiran-Rao  路  3Comments