- Fix: Have export handler, if triggered, always open a window even if no
window name was given (needed in Chrome to avoid opening an extra window)
- Fix (Embedded editor regression): Ensure event handlers are added even if
document cannot be directly modified
- Enhancement: Add `opts` object to `rasterExport` with `avoidEvent` property
to avoid calling the `exported` event
- Docs (CHANGES): Update
- Docs (README): Deemphasize unstable embedded editor fixes
This commit is contained in:
13
dist/index-es.js
vendored
13
dist/index-es.js
vendored
@@ -17417,12 +17417,15 @@ function SvgCanvas(container, config) {
|
||||
* @param {Float} [quality] Between 0 and 1
|
||||
* @param {string} [exportWindowName]
|
||||
* @param {module:svgcanvas.ImageExportedCallback} [cb]
|
||||
* @param {PlainObject} [opts]
|
||||
* @param {boolean} [opts.avoidEvent]
|
||||
* @fires module:svgcanvas.SvgCanvas#event:exported
|
||||
* @todo Confirm/fix ICO type
|
||||
* @returns {Promise} Resolves to {@link module:svgcanvas.ImageExportedResults}
|
||||
*/
|
||||
|
||||
this.rasterExport = function (imgType, quality, exportWindowName, cb) {
|
||||
var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
||||
var type = imgType === 'ICO' ? 'BMP' : imgType || 'PNG';
|
||||
var mimeType = 'image/' + type.toLowerCase();
|
||||
|
||||
@@ -17455,7 +17458,10 @@ function SvgCanvas(container, config) {
|
||||
quality: quality,
|
||||
exportWindowName: exportWindowName
|
||||
};
|
||||
call('exported', obj);
|
||||
|
||||
if (!opts.avoidEvent) {
|
||||
call('exported', obj);
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
cb(obj);
|
||||
@@ -29416,10 +29422,7 @@ editor.init = function () {
|
||||
var exportHandler = function exportHandler(win, data) {
|
||||
var issues = data.issues,
|
||||
exportWindowName = data.exportWindowName;
|
||||
|
||||
if (exportWindowName) {
|
||||
exportWindow = window.open(blankPageObjectURL || '', exportWindowName); // A hack to get the window via JSON-able name without opening a new one
|
||||
}
|
||||
exportWindow = window.open(blankPageObjectURL || '', exportWindowName); // A hack to get the window via JSON-able name without opening a new one
|
||||
|
||||
if (!exportWindow || exportWindow.closed) {
|
||||
$$b.alert(uiStrings$1.notification.popupWindowBlocked);
|
||||
|
||||
2
dist/index-es.min.js
vendored
2
dist/index-es.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index-es.min.js.map
vendored
2
dist/index-es.min.js.map
vendored
File diff suppressed because one or more lines are too long
13
dist/index-umd.js
vendored
13
dist/index-umd.js
vendored
@@ -17423,12 +17423,15 @@
|
||||
* @param {Float} [quality] Between 0 and 1
|
||||
* @param {string} [exportWindowName]
|
||||
* @param {module:svgcanvas.ImageExportedCallback} [cb]
|
||||
* @param {PlainObject} [opts]
|
||||
* @param {boolean} [opts.avoidEvent]
|
||||
* @fires module:svgcanvas.SvgCanvas#event:exported
|
||||
* @todo Confirm/fix ICO type
|
||||
* @returns {Promise} Resolves to {@link module:svgcanvas.ImageExportedResults}
|
||||
*/
|
||||
|
||||
this.rasterExport = function (imgType, quality, exportWindowName, cb) {
|
||||
var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
||||
var type = imgType === 'ICO' ? 'BMP' : imgType || 'PNG';
|
||||
var mimeType = 'image/' + type.toLowerCase();
|
||||
|
||||
@@ -17461,7 +17464,10 @@
|
||||
quality: quality,
|
||||
exportWindowName: exportWindowName
|
||||
};
|
||||
call('exported', obj);
|
||||
|
||||
if (!opts.avoidEvent) {
|
||||
call('exported', obj);
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
cb(obj);
|
||||
@@ -29422,10 +29428,7 @@
|
||||
var exportHandler = function exportHandler(win, data) {
|
||||
var issues = data.issues,
|
||||
exportWindowName = data.exportWindowName;
|
||||
|
||||
if (exportWindowName) {
|
||||
exportWindow = window.open(blankPageObjectURL || '', exportWindowName); // A hack to get the window via JSON-able name without opening a new one
|
||||
}
|
||||
exportWindow = window.open(blankPageObjectURL || '', exportWindowName); // A hack to get the window via JSON-able name without opening a new one
|
||||
|
||||
if (!exportWindow || exportWindow.closed) {
|
||||
$$b.alert(uiStrings$1.notification.popupWindowBlocked);
|
||||
|
||||
2
dist/index-umd.min.js
vendored
2
dist/index-umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index-umd.min.js.map
vendored
2
dist/index-umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user