- Fix (regression): Arg names not being passed on properly for addExtension

This commit is contained in:
Brett Zamir
2018-11-16 13:02:14 +08:00
parent 2e5c7557a9
commit c42791b2b2
2 changed files with 11 additions and 6 deletions

View File

@@ -6441,18 +6441,18 @@ editor.loadFromDataURI = function (str, {noAlert} = {}) {
/**
* @param {string} name Used internally; no need for i18n.
* @param {module:svgcanvas.ExtensionInitCallback} init Config to be invoked on this module
* @param {module:SVGEditor~ImportLocale} importLocale Importer defaulting to pth with current extension name and locale
* @param {module:svgcanvas.ExtensionInitArgs} initArgs
* @throws {Error} If called too early
* @returns {Promise} Resolves to `undefined`
*/
editor.addExtension = function (name, init, importLocale) {
editor.addExtension = function (name, init, initArgs) {
// Note that we don't want this on editor.ready since some extensions
// may want to run before then (like server_opensave).
// $(function () {
if (!svgCanvas) {
throw new Error('Extension added too early');
}
return svgCanvas.addExtension.call(this, name, init, importLocale);
return svgCanvas.addExtension.call(this, name, init, initArgs);
// });
};