mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Removed disabled blockquote height calculator for #902
This commit is contained in:
parent
e8669a20bb
commit
a1441c9f22
1 changed files with 4 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { doc, createElement } from 'Common/Globals';
|
import { createElement } from 'Common/Globals';
|
||||||
import { forEachObjectEntry, pInt } from 'Common/Utils';
|
import { forEachObjectEntry, pInt } from 'Common/Utils';
|
||||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||||
|
|
||||||
|
|
@ -14,27 +14,13 @@ const
|
||||||
"'": '''
|
"'": '''
|
||||||
},
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
hcont = Element.fromHTML('<div area="hidden" style="position:absolute;top:0;left:-200vw;max-width:max(50vw,400px);max-height:50vh"></div>'),
|
|
||||||
|
|
||||||
blockquoteSwitcher = () => {
|
blockquoteSwitcher = () => {
|
||||||
SettingsUserStore.collapseBlockquotes() &&
|
SettingsUserStore.collapseBlockquotes() &&
|
||||||
// tpl.content.querySelectorAll('blockquote').forEach(node => {
|
// tpl.content.querySelectorAll('blockquote').forEach(node => {
|
||||||
[...tpl.content.querySelectorAll('blockquote')].reverse().forEach(node => {
|
[...tpl.content.querySelectorAll('blockquote')].reverse().forEach(node => {
|
||||||
let h = node.scrollHeight;
|
const el = Element.fromHTML('<details class="sm-bq-switcher"><summary>•••</summary></details>');
|
||||||
/*
|
node.replaceWith(el);
|
||||||
if (!h) {
|
el.append(node);
|
||||||
// Attempt to get height
|
|
||||||
hcont.innerHTML = node.outerHTML;
|
|
||||||
h = hcont.scrollHeight;
|
|
||||||
hcont.innerHTML = '';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (0 === h || 100 < h) {
|
|
||||||
const el = Element.fromHTML('<details class="sm-bq-switcher"><summary>•••</summary></details>');
|
|
||||||
node.replaceWith(el);
|
|
||||||
el.append(node);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -103,8 +89,6 @@ const
|
||||||
return url;
|
return url;
|
||||||
};
|
};
|
||||||
|
|
||||||
doc.body.append(hcont);
|
|
||||||
|
|
||||||
export const
|
export const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue