Summernote: Change content of Style drop down

Created on 4 Jun 2015  Â·  4Comments  Â·  Source: summernote/summernote

Is it possible to configure the "style" botton configuration so that the drop down only contains NORMAL, QUOTE and CODE and not the remaining HEADER options?

Most helpful comment

You should be able to achieve this with the "custom toolbar" (see http://summernote.org/#/deep-dive#custom-toolbar). Try this

$(".summernote").summernote({
    // default value is ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
    styleTags: ['p', 'blockquote', 'pre']
});

(N.b. same issue as #170)

All 4 comments

hi @PowerPalle

summernote don't support dropdown menu's setting yet.

but you can use like below code to change button element.

$(".summernote").summernote({
    onInit : function() {
       // get style group button 
        var $styleBtn = $(".summernote").summernote("toolbar.get", "style");

       // hide heading menu 
        $styleBtn.find("[data-value^=h]").parent().hide();
    }
});


You should be able to achieve this with the "custom toolbar" (see http://summernote.org/#/deep-dive#custom-toolbar). Try this

$(".summernote").summernote({
    // default value is ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']
    styleTags: ['p', 'blockquote', 'pre']
});

(N.b. same issue as #170)

Hi Jihno

Thanks for the advise all though I am not sure what you mean it the code below.

When do you expect to introduce dropdown menu setting?

/Palle

On 05/06/2015, at 04.33, jinho park [email protected] wrote:

hi @PowerPalle https://github.com/PowerPalle
summernote don't support dropdown menu's setting yet.

but you can use like below code to change button element.

$(".summernote").summernote({
onInit : function() {
// get style group button
var $styleBtn = $(".summernote").summernote("toolbar.get", "style");

   // hide heading menu 
    $styleBtn.find("[data-value^=h]").parent().hide();
}

});

—
Reply to this email directly or view it on GitHub https://github.com/summernote/summernote/issues/1130#issuecomment-109139095.

@davidsulc :+1:

Was this page helpful?
0 / 5 - 0 ratings