Coder Social home page Coder Social logo

Comments (9)

nynevi avatar nynevi commented on August 19, 2024 3

ugly but works:

    .cdx-settings-button[data-level='1'],
    .cdx-settings-button[data-level='4'],
    .cdx-settings-button[data-level='5'],
    .cdx-settings-button[data-level='6'] {
      display: none;
    }

I used the same method for hiding image options but it had an explicity classname so using the above method with -settings- might break other plugin options that has levels

.image-tool__tune {
     display: none;
}

from header.

igorivaniuk avatar igorivaniuk commented on August 19, 2024 3

Or extend Header class

class MyHeader extends Header {
  get levels() {
    return super.levels.filter((l: any) => [2, 3, 4].includes(l.number));
  }

  get defaultLevel() {
    /**
     * Use H2 as default header
     */
    return this.levels[0];
  }
}

editorjs

from header.

zizther avatar zizther commented on August 19, 2024 3

Even though it is possible to extend, it would be nice to see this built in as an option.

from header.

Farrien avatar Farrien commented on August 19, 2024

I was looking for how to prevent users from using some of the heading levels too.

from header.

talyguryn avatar talyguryn commented on August 19, 2024

Sorry, my bad

from header.

damien-monni avatar damien-monni commented on August 19, 2024

I agree, it would be nice!

from header.

sandrooco avatar sandrooco commented on August 19, 2024

@igorivaniuk Extending like you did doesn't work for me:

Type 'typeof CustomHeading' is not assignable to type 'BaseToolConstructable'.
Property 'render' is missing in type 'CustomHeading' but required in type 'BaseTool'.

If I use heading: CustomHeading as BaseToolConstructable, it will build (and work..) but still throw an error in the terminal.

from header.

neSpecc avatar neSpecc commented on August 19, 2024

It can be done by adding a corresponding config option. You are welcome to implement this feature and send a PR.

from header.

alexanderhorner avatar alexanderhorner commented on August 19, 2024

Extending doesn't work for me

SyntaxError: Unexpected token ':'. Expected ')' to end a compound expression.

from header.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.