mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Extend the use of ResizeObserver by dropping all knockoutjs observable this.resizerTrigger in mail composer
As benefit this also drops the CustomEvent('resize.real')
This commit is contained in:
parent
35c9f3fff5
commit
d1c06a8ece
10 changed files with 48 additions and 117 deletions
16
dev/External/ko.js
vendored
16
dev/External/ko.js
vendored
|
|
@ -245,22 +245,6 @@ ko.bindingHandlers.initDom = {
|
|||
init: (element, fValueAccessor) => fValueAccessor()(element)
|
||||
};
|
||||
|
||||
ko.bindingHandlers.initResizeTrigger = {
|
||||
init: (element, fValueAccessor) =>
|
||||
element.style.height = element.style.minHeight = ko.unwrap(fValueAccessor())[1] + 'px',
|
||||
update: (element, fValueAccessor) => {
|
||||
const values = ko.unwrap(fValueAccessor());
|
||||
let offset = element.getBoundingClientRect().top + pageYOffset;
|
||||
if (0 < offset) {
|
||||
offset += parseInt(values[2], 10) || 0;
|
||||
element.style.height = element.style.minHeight = Math.max(
|
||||
parseInt(values[1], 10) || 0,
|
||||
window.innerHeight - offset
|
||||
) + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.appendDom = {
|
||||
update: (element, fValueAccessor) => {
|
||||
$(element)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue