I can't test right now, but calling this.$editor.focus()
might set the focus on the wrong element when restoring the selection. According to the examples, just calling this.selectionRestore()
should be enough: http://imperavi.com/redactor/examples/plugin-modal/
Have you tried it without the this.$editor.focus()
statement?
Another thing I take away from the example is that they don't call the this.selectionSave()
from the this.buttonAdd
callback, but rather when creating the modal dialog (in their case). It's really hard to tell whether the modal behaviour would be different from the dropdown behaviour, but you could try using a modal and see if that fixes your problem.