mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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 (!oStyle.backgroundImage) {
|
||||
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
|
||||
if (hasAttribute('width') && !oStyle.width) {
|
||||
value = delAttribute('width');
|
||||
oStyle.width = value.includes('%') ? value : value + 'px';
|
||||
}
|
||||
value = oStyle.width;
|
||||
if (100 < parseInt(value,10) && !oStyle.maxWidth) {
|
||||
oStyle.maxWidth = value;
|
||||
oStyle.width = '100%';
|
||||
} else if (!value?.includes('%')) {
|
||||
oStyle.removeProperty('width');
|
||||
}
|
||||
// Make height responsive
|
||||
if (hasAttribute('height')) {
|
||||
value = delAttribute('height');
|
||||
oStyle.height = value.includes('%') ? value : value + 'px';
|
||||
}
|
||||
value = oStyle.removeProperty('height');
|
||||
if (value && !oStyle.maxHeight) {
|
||||
oStyle.maxHeight = value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue