Wysiwyg-editor: show and hide methods not working

Created on 12 Sep 2014  路  4Comments  路  Source: froala/wysiwyg-editor

I believe the show and hide methods are meant to show and hide the toolbar. This guy was looking for something like that as well. They appear to do nothing :(.

Most helpful comment

If anybody is still looking how to do this.. this works...

      events: {
        'froalaEditor.initialized': (e, editor) => {
          editor.toolbar.hide();
        },
        'froalaEditor.focus': (e, editor) => {
          editor.toolbar.show();
        },
        'froalaEditor.blur': (e, editor) => {
          editor.toolbar.hide();
        },
      },

All 4 comments

The show and hide buttons work fine. They hide/show the editor when using inlineMode. There is no sense to hide the toolbar when not using inlineMode.

Just a head up regarding this. In the version 1.2.7 it is possible to hide/show the toolbar this way:

  • listen to the focus/blur events
  • inside the listener you can get the toolbar using editor.$editor and call the jQuery show/hide methods on it.

If anybody is still looking how to do this.. this works...

      events: {
        'froalaEditor.initialized': (e, editor) => {
          editor.toolbar.hide();
        },
        'froalaEditor.focus': (e, editor) => {
          editor.toolbar.show();
        },
        'froalaEditor.blur': (e, editor) => {
          editor.toolbar.hide();
        },
      },

I use this code to toggle Edit or View mode from external button

//--------- Hide Editor -----------------
$("#editor").froalaEditor('edit.off');
$("#editor").froalaEditor('toolbar.hide');

//--------- Show Editor -----------------
$("#editor").froalaEditor('edit.on');
$("#editor").froalaEditor('toolbar.show');
Was this page helpful?
0 / 5 - 0 ratings

Related issues

cristianst picture cristianst  路  4Comments

bbugh picture bbugh  路  3Comments

lohiaad picture lohiaad  路  4Comments

Nucs picture Nucs  路  4Comments

rogersteblerbsi picture rogersteblerbsi  路  3Comments