mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Resolve #1134
This commit is contained in:
parent
02576302c9
commit
197f597d1c
1 changed files with 6 additions and 10 deletions
|
|
@ -358,23 +358,19 @@ export const
|
||||||
// if ('TABLE' === name || 'TD' === name || 'TH' === name) {
|
// if ('TABLE' === name || 'TD' === name || 'TH' === name) {
|
||||||
if (!oStyle.backgroundImage) {
|
if (!oStyle.backgroundImage) {
|
||||||
if ('TD' !== name && 'TH' !== name) {
|
if ('TD' !== name && 'TH' !== name) {
|
||||||
|
['width','height'].forEach(key => {
|
||||||
|
if (hasAttribute(key)) {
|
||||||
|
value = delAttribute(key);
|
||||||
|
oStyle[key] || (oStyle[key] = value.includes('%') ? value : value + 'px');
|
||||||
|
}
|
||||||
|
});
|
||||||
// Make width responsive
|
// Make width responsive
|
||||||
if (hasAttribute('width') && !oStyle.width) {
|
|
||||||
value = delAttribute('width');
|
|
||||||
oStyle.width = value.includes('%') ? value : value + 'px';
|
|
||||||
}
|
|
||||||
value = oStyle.width;
|
value = oStyle.width;
|
||||||
if (100 < parseInt(value,10) && !oStyle.maxWidth) {
|
if (100 < parseInt(value,10) && !oStyle.maxWidth) {
|
||||||
oStyle.maxWidth = value;
|
oStyle.maxWidth = value;
|
||||||
oStyle.width = '100%';
|
oStyle.width = '100%';
|
||||||
} else if (!value?.includes('%')) {
|
|
||||||
oStyle.removeProperty('width');
|
|
||||||
}
|
}
|
||||||
// Make height responsive
|
// Make height responsive
|
||||||
if (hasAttribute('height')) {
|
|
||||||
value = delAttribute('height');
|
|
||||||
oStyle.height = value.includes('%') ? value : value + 'px';
|
|
||||||
}
|
|
||||||
value = oStyle.removeProperty('height');
|
value = oStyle.removeProperty('height');
|
||||||
if (value && !oStyle.maxHeight) {
|
if (value && !oStyle.maxHeight) {
|
||||||
oStyle.maxHeight = value;
|
oStyle.maxHeight = value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue