#603 unwanted function removed and translate changes

This commit is contained in:
agriyadev5
2021-08-24 16:13:50 +05:30
parent d2c6729d7b
commit f908f9b8a1
7 changed files with 11 additions and 88 deletions

View File

@@ -180,38 +180,6 @@ class Editor extends EditorStartup {
* @returns {void}
*/
/**
* Allows one to override default SVGEdit `open`, `save`, and
* `export` editor behaviors.
* @function module:SVGthis.setCustomHandlers
* @param {module:SVGthis.CustomHandler} opts Extension mechanisms may call `setCustomHandlers` with three functions: `opts.open`, `opts.save`, and `opts.exportImage`
* @returns {Promise<void>}
*/
/**
* @param {PlainObject} opts
* @returns {Promise<PlainObject>}
*/
setCustomHandlers(opts) {
return this.ready(() => {
if (opts.open) {
this.svgCanvas.open = opts.open.bind(this);
}
if (opts.save) {
this.showSaveWarning = false;
this.svgCanvas.bind('saved', opts.save.bind(this));
}
if (opts.exportImage) {
this.customExportImage = opts.exportImage.bind(this);
this.svgCanvas.bind('exported', this.customExportImage); // canvg and our RGBColor will be available to the method
}
if (opts.exportPDF) {
this.customExportPDF = opts.exportPDF.bind(this);
this.svgCanvas.bind('exportedPDF', this.customExportPDF); // jsPDF and our RGBColor will be available to the method
}
});
}
/**
* @function module:SVGthis.randomizeIds
* @param {boolean} arg