How to edit codemirror dialog?

I am using dialog.js to display a search box in my editor instance. The setup is pretty much the same as the search/replace demo on the codemirror website. All that is working as expected; when I hit cmd+f the search shows and works.

However, I’d like to edit some of the dialog options, like closeOnBlur, and change the the template a bit.

How does one go about doing this with this (or any other) addon that doesn’t define options to a CM instance?

I’ve tried to find examples online, but most of what I could find was using the normal implementation. I found this website that has a custom dialog and functionality, however the source of obfuscated.

Any help would be greatly appreciated.

Does passing the options when you call openDialog not work?

Firstly apologies for the incoming use of incorrect terminology and thank you for the reply.

Does passing the options when you call openDialog not work?

That does work, but I was wondering if I could just edit the default dialog being used. I will attempt to explain.

Installing the required addon files makes search work “out of the box.” I don’t need to do anything and search works when I hit cmd-f.

However, if I want to edit closeOnBlur it seems like I have to create a new “instance” of the openDialog, rather than just passing an option to the default instance.

Perhaps I am going about it in the wrong way, but in order to change closeOnBlur to false, I had to called the openDialog method from my cmd-f key command and pass it everything template, callback options, etc…

something along the lines of:

extraKeys: {
   "Cmd-F": function(cm) {
        editorInstance.openDialog(myTemplate, myCallback, myOptions);
    }
}

And when I did that, closeOnBlur did function as expected, but I had to redefine all the other default behavior and markup.

I feel like I might be going about this incorrectly. If I want to change the template or single option, do I need to do as described above? If so, is there anyway to pass defaults to some options?

Ah, no, that indeed doesn’t appear to be supported without forking the addon.

Got ya, thank you very much for the replies!