Skip to content

Commit

Permalink
fix(fitHeight): improved algorithm simplified (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Jul 9, 2023
1 parent 3df5562 commit 42bccfa
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 189 deletions.
13 changes: 0 additions & 13 deletions dist/core/index.js

This file was deleted.

21 changes: 4 additions & 17 deletions dist/cupertino-pane.esm.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Cupertino Pane 1.3.32
* Cupertino Pane 1.3.33
* New generation interfaces for web3 progressive applications
* https://github.com/roman-rr/cupertino-pane/
*
* Copyright 2019-2023 Roman Antonov (roman-rr)
*
* Released under the MIT License
*
* Released on: July 9, 2023
* Released on: July 10, 2023
*/

/******************************************************************************
Expand Down Expand Up @@ -1597,21 +1597,8 @@ class FitHeightModule {
}
yield Promise.all(promises);
yield new Promise(resolve => requestAnimationFrame(resolve));
// Calculate heights
const getHeight = (el) => Math.round(el.getBoundingClientRect().height);
let contentElHeight = getHeight(this.instance.el);
let diff = this.contentElHeight - contentElHeight;
// If content el changes
let paneElHeight = getHeight(this.instance.paneEl);
if (Math.abs(diff)) {
paneElHeight -= diff;
}
// Set value for future checks
this.contentElHeight = getHeight(this.instance.el);
// Fit to screen if fitScreenHeight happens
if (getHeight(this.instance.el) > this.instance.screen_height) {
this.contentElHeight = this.instance.screen_height;
}
// Base calc
let paneElHeight = Math.round(this.instance.paneEl.getBoundingClientRect().height);
// Hide elements back
if (!this.instance.rendered) {
this.instance.el.style.visibility = 'unset';
Expand Down
14 changes: 0 additions & 14 deletions dist/cupertino-pane.esm.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/cupertino-pane.esm.min.js.map

This file was deleted.

22 changes: 4 additions & 18 deletions dist/cupertino-pane.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Cupertino Pane 1.3.32
* Cupertino Pane 1.3.33
* New generation interfaces for web3 progressive applications
* https://github.com/roman-rr/cupertino-pane/
*
* Copyright 2019-2023 Roman Antonov (roman-rr)
*
* Released under the MIT License
*
* Released on: July 9, 2023
* Released on: July 10, 2023
*/

(function (global, factory) {
Expand Down Expand Up @@ -1603,21 +1603,8 @@
}
yield Promise.all(promises);
yield new Promise(resolve => requestAnimationFrame(resolve));
// Calculate heights
const getHeight = (el) => Math.round(el.getBoundingClientRect().height);
let contentElHeight = getHeight(this.instance.el);
let diff = this.contentElHeight - contentElHeight;
// If content el changes
let paneElHeight = getHeight(this.instance.paneEl);
if (Math.abs(diff)) {
paneElHeight -= diff;
}
// Set value for future checks
this.contentElHeight = getHeight(this.instance.el);
// Fit to screen if fitScreenHeight happens
if (getHeight(this.instance.el) > this.instance.screen_height) {
this.contentElHeight = this.instance.screen_height;
}
// Base calc
let paneElHeight = Math.round(this.instance.paneEl.getBoundingClientRect().height);
// Hide elements back
if (!this.instance.rendered) {
this.instance.el.style.visibility = 'unset';
Expand Down Expand Up @@ -2404,4 +2391,3 @@
return CupertinoPane;

}));
//# sourceMappingURL=cupertino-pane.js.map
1 change: 0 additions & 1 deletion dist/cupertino-pane.js.map

This file was deleted.

14 changes: 0 additions & 14 deletions dist/cupertino-pane.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/cupertino-pane.min.js.map

This file was deleted.

13 changes: 0 additions & 13 deletions dist/modules/backdrop.js

This file was deleted.

13 changes: 0 additions & 13 deletions dist/modules/fit-height.js

This file was deleted.

13 changes: 0 additions & 13 deletions dist/modules/follower.js

This file was deleted.

13 changes: 0 additions & 13 deletions dist/modules/horizontal.js

This file was deleted.

14 changes: 0 additions & 14 deletions dist/modules/index.js

This file was deleted.

Loading

0 comments on commit 42bccfa

Please sign in to comment.