Search code examples
javascriptbackbone.jsconverse.js

How to change between fullscreen and overlayed chat with button click event in converse.js


I'm trying to put a button to change overlayed view to fullscreen, and another one from overlayed to fullscreen without using HTML redirection.

Tried to use converse.api.settings.update but it does not work, looks like it's not rendering the page with view_mode variable updated.

Tried with the next code in a function, and even added this.render(), but not working:

converse.initialize({
  view_mode: 'fullscreen'
});

_converse.api.settings.update({
  view_mode: 'fullscreen'
});

Solution

  • Thanks for the answer, but I wanted to "on the fly".

    Finally I achieved it "on the fly" but making some tricks and probably wrong stuff, but what I did was to remove all classes in DOM referring to 'converse-overlayed' and later, initialize again the plugin:

    converse.initialize({ 
    ... view_mode: 'fullscreen' 
    });
    

    Same for the opposite.