Update plugin.js

Replaced editor.document.on events with editor.on because editor.document.on events are destroyed when setData is called.