Announcement

Collapse
No announcement yet.

Ability to Hide WYSIWYG Toolbar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ability to Hide WYSIWYG Toolbar

    It would be nice - for space-saving reasons - to be able to hide the WYSIWYG formatting toolbar.

    Setting the `toolbar` param to `null` doesn't have an effect:

    Code:
    this.createField('description', 'views/fields/wysiwyg', {mode: this.mode === 'edit' ? 'edit' : 'list'}, {rows: 3, toolbar: null});
    However, adding a `hideToolbar` param would allow this to happen:

    client/src/views/fields/wysiwyg.js

    Code:
    setup: function () {
        Dep.prototype.setup.call(this);
        this.hasBodyPlainField = !!~this.getFieldManager().getEntityTypeFieldList(this.model.entityType).indexOf(this.name + 'Plain');
        if ('height' in this.params) {
            this.height = this.params.height;
        }
        if ('minHeight' in this.params) {
            this.minHeight = this.params.minHeight;
        }
        this.useIframe = this.params.useIframe || this.useIframe;
        this.toolbar = this.params.toolbar || [
            ['style', ['style']],
            ['style', ['bold', 'italic', 'underline', 'clear']],
            ['fontsize', ['fontsize']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
            ['height', ['height']],
            ['table', ['table', 'link', 'picture', 'hr']],
            ['misc',['codeview', 'fullscreen']]
        ];
    
        // Check for the hideToolbar param so we can completely disable the toolbar
        if (this.params.hideToolbar) {
            this.toolbar = null;
        }
    
        ...
    }
    And thus can be used as follows:

    Code:
    this.createField('description', 'views/fields/wysiwyg', {mode: this.mode === 'edit' ? 'edit' : 'list'}, {rows: 3, hideToolbar: true});

  • #2
    Pull request when?

    But these this still have the option to "show" toolbar upon clicking a button or Hotkey? Or is it a permanent disappearing solution.

    Comment

    Working...
    X