Skip to content

custom link popover? #2534

@fghhfg

Description

@fghhfg

How to add a custom button on link popover?

steps to reproduce

I try to add a custom button on link popover

just simple modify example from
https://summernote.org/deep-dive/#using-button-with-options
https://summernote.org/deep-dive/#initialization-options

var HelloButton = function (context) {
  var ui = $.summernote.ui;

  // create button
  var button = ui.button({
    contents: '<i class="fa fa-child"/> Hello',
    tooltip: 'hello',
    click: function () {
      // invoke insertText method with 'hello' on editor module.
      context.invoke('editor.insertText', 'hello');
    }
  });

  return button.render();   // return button as jquery object
}
    $(document).ready(function() {
        $('#summernote').summernote({
            popover: {
                link: [
                    ['custom', ['HelloButton']],
                    ['link', ['HelloButton', 'linkDialogShow']]
                ]
            }
        });
    });

https://jsfiddle.net/1Lwcahbk/

browser version and os version and summernote version

What is your browser and OS?
win7 chrome (electron)
What is your summernote version?
v0.8.8

screenshot of issue

2017-11-05 19_32_12-summernote

Where is my custom button?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions