yushiro / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

Events for successful loading of new file, and successful saving of file #1047

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I would like to update various pieces of information in the web page when a new 
file is successfully loaded into svg-edit, and also when a file is saved. As 
far as I can see, http://code.google.com/p/svg-edit/wiki/ExtensionDocs does not 
list these as events that can be hooked on to. Is there any way of doing this?

Original issue reported on code.google.com by hyanw...@googlemail.com on 6 Feb 2013 at 4:47

GoogleCodeExporter commented 9 years ago
For saving, you might try this (I don't see any hooks for loading, so feel free 
to submit a patch in case we may be able to review and approve):

var oldHandler = svgCanvas.bind('saved', function newHandler () {
    // Optionally also keep the old behavior
    oldHandler();
});

(Bind replaces the old handler function (in this case, the built-in 
saveHandler), but makes it available as the return value, so you can use it if 
desired)

Original comment by bret...@gmail.com on 22 May 2014 at 11:42