- 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:
@@ -17420,12 +17420,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();
|
||||
|
||||
@@ -17458,7 +17461,10 @@
|
||||
quality: quality,
|
||||
exportWindowName: exportWindowName
|
||||
};
|
||||
call('exported', obj);
|
||||
|
||||
if (!opts.avoidEvent) {
|
||||
call('exported', obj);
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
cb(obj);
|
||||
@@ -29419,10 +29425,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);
|
||||
|
||||
Reference in New Issue
Block a user