javascriptjqueryeditornicedit

nicEditor add/remove icons using jquery


I have tried to add a rich text editor to my application. I'm using nicEdit.

bkLib.onDomLoaded(function() {
  nicEditors.editors.push(new nicEditor().panelInstance(document.getElementById('single_answer_description')));
});

I added this part to convert my normal textarea to a richtext editor. It looks fine:

enter image description here

What I want to do now is to only show some of the icons like B, I, U. I don't want all the icons. How can I hide those? I also want to set font family by default inside the rich text editor content.

I tried to search so many links but I couldn't get any proper solution for this issue. Please help me to get out of this issue. Thanks in advance.


Solution

  • As per the documentation

    You can add an array of the buttons you want when you instantiate the object.

    bkLib.onDomLoaded(function() {
      nicEditors.editors.push(
        new nicEditor({buttonList:['bold','italic']}).panelInstance(document.getElementById('single_answer_description')));
    });