Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Settings (caption, withBorder, withBackground, stretched) #29

Closed
SebastianVomMeer opened this issue May 9, 2019 · 6 comments · Fixed by #269
Closed

Disable Settings (caption, withBorder, withBackground, stretched) #29

SebastianVomMeer opened this issue May 9, 2019 · 6 comments · Fixed by #269

Comments

@SebastianVomMeer
Copy link

I am new to Editor.js and not sure if this is plugin-specific or not. Is it possible to disable specific settings (caption, withBorder, withBackground, stretched) or disable settings at all? I don't need a background variant, so the user shouldn't be able to choose it in the first place.

Thank you very much, I appreciate your work!

@lininu
Copy link

lininu commented Jul 1, 2019

Accroding to No ability to provide available levels #14, I tried to extend ImageTool and just render default zone.

const ImageTool = require('@editorjs/image');

class MyImageTool extends ImageTool {
  renderSettings() {
    const div = document.createElement('div');
    div.style.marginTop = '-6px';
    return div;
  }
}

const editor = new EditorJS({
  holder: 'codex-editor',
  autofocus: true,
  tools: {
    image: {
      class: MyImageTool,
    }
  }
});

But in Caption case, I am not sure about the best solution. Currently I just make .image-tool__caption { display: none; }.

@ovo4096
Copy link

ovo4096 commented Sep 13, 2019

.cdx-settings-button[data-tune='withBorder'],
.cdx-settings-button[data-tune='withBackground'],
.cdx-settings-button[data-tune='stretched'] {
  display: none;
}

easy method

@Duncank
Copy link
Contributor

Duncank commented Jul 27, 2020

I've created a pull request with the option to configure which default elements you want to disable. Check it out here.

@JayPokale
Copy link

This works for me
// CSS Code
.ce-popover__item[data-item-name="withBorder"],
.ce-popover__item[data-item-name="withBackground"],
.ce-popover__item[data-item-name="stretched"] {
display: none;
}

@simpleoo0o
Copy link

import ImageTool from '@editorjs/image'

Object.defineProperty(ImageTool, 'tunes', {
get: function() { return [] }
})

@idebenone
Copy link
Member

Closing this as it has been added in #269.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants