#103 image import issue fixed
parent
0579213abf
commit
203af05cd5
|
@ -655,7 +655,7 @@ class EditorStartup {
|
||||||
editorObj.svgCanvas.selectOnly([ newImage ]);
|
editorObj.svgCanvas.selectOnly([ newImage ]);
|
||||||
editorObj.svgCanvas.alignSelectedElements('m', 'page');
|
editorObj.svgCanvas.alignSelectedElements('m', 'page');
|
||||||
editorObj.svgCanvas.alignSelectedElements('c', 'page');
|
editorObj.svgCanvas.alignSelectedElements('c', 'page');
|
||||||
editorObj.topPanelHandlers.updateContextPanel();
|
editorObj.topPanel.updateContextPanel();
|
||||||
document.getElementById('se-prompt-dialog').setAttribute('close', true);
|
document.getElementById('se-prompt-dialog').setAttribute('close', true);
|
||||||
};
|
};
|
||||||
// create dummy img so we know the default dimensions
|
// create dummy img so we know the default dimensions
|
||||||
|
|
|
@ -351,7 +351,7 @@ export const setSvgString = function (xmlString, preventUndo) {
|
||||||
const elements = content.querySelectorAll('image');
|
const elements = content.querySelectorAll('image');
|
||||||
Array.prototype.forEach.call(elements, function (image) {
|
Array.prototype.forEach.call(elements, function (image) {
|
||||||
preventClickDefault(image);
|
preventClickDefault(image);
|
||||||
const val = svgContext_.getCanvas().getHref(this);
|
const val = svgContext_.getCanvas().getHref(image);
|
||||||
if (val) {
|
if (val) {
|
||||||
if (val.startsWith('data:')) {
|
if (val.startsWith('data:')) {
|
||||||
// Check if an SVG-edit data URI
|
// Check if an SVG-edit data URI
|
||||||
|
|
|
@ -1324,11 +1324,8 @@ export const snapToGrid = function (value) {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const preventClickDefault = function (img) {
|
export const preventClickDefault = function (img) {
|
||||||
const elements = document.querySelectorAll(img);
|
img.addEventListener('click', function (e) {
|
||||||
Array.from(elements).forEach(function (element) {
|
e.preventDefault();
|
||||||
element.addEventListener('click', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue