#se-img-prop-dialog error class set changes
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable node/no-unpublished-import */
|
/* eslint-disable node/no-unpublished-import */
|
||||||
import 'elix/define/Dialog.js';
|
import 'elix/define/Dialog.js';
|
||||||
|
import {isValidUnit} from '../../common/units.js';
|
||||||
|
|
||||||
const template = document.createElement('template');
|
const template = document.createElement('template');
|
||||||
template.innerHTML = `
|
template.innerHTML = `
|
||||||
@@ -298,6 +299,18 @@ export class SeImgPropDialog extends HTMLElement {
|
|||||||
};
|
};
|
||||||
const onSaveHandler = (ev) => {
|
const onSaveHandler = (ev) => {
|
||||||
let saveOpt = '';
|
let saveOpt = '';
|
||||||
|
const w = this.$canvasWidth.value;
|
||||||
|
const h = this.$canvasHeight.value;
|
||||||
|
if (w !== 'fit' && !isValidUnit('width', w)) {
|
||||||
|
this.$canvasWidth.parentElement.classList.add('error');
|
||||||
|
} else {
|
||||||
|
this.$canvasWidth.parentElement.classList.remove('error');
|
||||||
|
}
|
||||||
|
if (h !== 'fit' && !isValidUnit('height', w)) {
|
||||||
|
this.$canvasHeight.parentElement.classList.add('error');
|
||||||
|
} else {
|
||||||
|
this.$canvasHeight.parentElement.classList.remove('error');
|
||||||
|
}
|
||||||
if (this.$imageOptEmbed.getAttribute('checked') === 'true') {
|
if (this.$imageOptEmbed.getAttribute('checked') === 'true') {
|
||||||
saveOpt = 'embed';
|
saveOpt = 'embed';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3919,17 +3919,13 @@ editor.init = () => {
|
|||||||
svgCanvas.setDocumentTitle(title);
|
svgCanvas.setDocumentTitle(title);
|
||||||
|
|
||||||
if (w !== 'fit' && !isValidUnit('width', w)) {
|
if (w !== 'fit' && !isValidUnit('width', w)) {
|
||||||
// width.parentElement.classList.add('error');
|
|
||||||
/* await */ $.alert(uiStrings.notification.invalidAttrValGiven);
|
/* await */ $.alert(uiStrings.notification.invalidAttrValGiven);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// width.parentElement.classList.remove('error');
|
|
||||||
if (h !== 'fit' && !isValidUnit('height', h)) {
|
if (h !== 'fit' && !isValidUnit('height', h)) {
|
||||||
// height.parentElement.classList.add('error');
|
|
||||||
/* await */ $.alert(uiStrings.notification.invalidAttrValGiven);
|
/* await */ $.alert(uiStrings.notification.invalidAttrValGiven);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// height.parentElement.classList.remove('error');
|
|
||||||
if (!svgCanvas.setResolution(w, h)) {
|
if (!svgCanvas.setResolution(w, h)) {
|
||||||
/* await */ $.alert(uiStrings.notification.noContentToFitTo);
|
/* await */ $.alert(uiStrings.notification.noContentToFitTo);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user