mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-08 07:48:02 +08:00
Improved message responsive resizing #678
This commit is contained in:
parent
565c8b13fa
commit
ee5fb1a83e
1 changed files with 16 additions and 21 deletions
|
@ -229,33 +229,28 @@ export const
|
|||
|
||||
// if ('TABLE' === name || 'TD' === name || 'TH' === name) {
|
||||
if (!oStyle.backgroundImage) {
|
||||
value = oStyle.width;
|
||||
if (hasAttribute('width')) {
|
||||
if (!value) {
|
||||
if ('TD' !== name && 'TH' !== name) {
|
||||
// Make width responsive
|
||||
if (hasAttribute('width')) {
|
||||
value = getAttribute('width');
|
||||
value = value.includes('%') ? value : value + 'px';
|
||||
if (1 < pInt(value)) {
|
||||
oStyle.width = value;
|
||||
}
|
||||
oStyle.width = value.includes('%') ? value : value + 'px';
|
||||
delAttribute('width');
|
||||
}
|
||||
delAttribute('width');
|
||||
}
|
||||
if (value && !value.includes('%')) {
|
||||
oStyle.maxWidth = value;
|
||||
if ('TD' !== name && 'TH' !== name) {
|
||||
value = oStyle.removeProperty('width');
|
||||
if (value) {
|
||||
oStyle.maxWidth = value;
|
||||
oStyle.width = '100%';
|
||||
}
|
||||
}
|
||||
if (hasAttribute('height')) {
|
||||
value = getAttribute('height');
|
||||
if (pInt(value)) {
|
||||
// Make height responsive
|
||||
if (hasAttribute('height')) {
|
||||
value = getAttribute('height');
|
||||
oStyle.height = value.includes('%') ? value : value + 'px';
|
||||
delAttribute('height');
|
||||
}
|
||||
value = oStyle.removeProperty('height');
|
||||
if (value) {
|
||||
oStyle.maxHeight = value;
|
||||
}
|
||||
delAttribute('height');
|
||||
}
|
||||
value = oStyle.removeProperty('height');
|
||||
if (value && !value.includes('%')) {
|
||||
oStyle.maxHeight = value;
|
||||
}
|
||||
}
|
||||
// } else
|
||||
|
|
Loading…
Reference in a new issue