Skip to content

Commit

Permalink
enhance(core): fast initialization (#186) - quickfix
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Jun 24, 2023
1 parent b36600b commit daa1eee
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 41 deletions.
2 changes: 1 addition & 1 deletion dist/core/index.js

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions dist/cupertino-pane.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,6 @@ class CupertinoPane {
console.warn('Cupertino Pane: specified selector or DOM element already in use', this.selector);
return;
}
console.time("Presenting time");
// Emit event
this.emit('onWillPresent');
this.updateScreenHeights();
Expand All @@ -2101,9 +2100,6 @@ class CupertinoPane {
// Custom transitions for present/destroy: set styles
Object.assign(this.paneEl.style, (_a = conf === null || conf === void 0 ? void 0 : conf.transition) === null || _a === void 0 ? void 0 : _a.from);
// Show elements
// For some reason need requestAnimationFrame after show wrapper to make
// initial transition works
// TODO: resolve animation frame for transition on pane init
this.wrapperEl.style.display = 'block';
this.contentEl.style.display = 'block';
this.wrapperEl.classList.add('rendered');
Expand Down Expand Up @@ -2143,7 +2139,6 @@ class CupertinoPane {
this.emit('beforePresentTransition', { animate: conf.animate });
// One frame before transition
yield new Promise(resolve => requestAnimationFrame(resolve));
console.timeEnd("Presenting time");
if (conf.animate) {
yield this.transitions.doTransition({
type: 'present', conf,
Expand Down Expand Up @@ -2178,12 +2173,11 @@ class CupertinoPane {
this.overflowEl.style.overflowX = 'hidden';
}
this.overflowEl.style.overscrollBehavior = 'none';
if (this.settings.topperOverflow) {
if (this.settings.upperThanTop) {
console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"');
}
this.setOverflowHeight();
if (this.settings.topperOverflow
&& this.settings.upperThanTop) {
console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"');
}
this.setOverflowHeight();
}
setOverflowHeight(offset = 0) {
this.overflowEl.style.height = `${this.getPaneHeight()
Expand Down
2 changes: 1 addition & 1 deletion dist/cupertino-pane.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.esm.min.js.map

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions dist/cupertino-pane.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cupertino-pane",
"description": "New generation interfaces for web3 progressive applications",
"version": "1.3.3",
"version": "1.3.31",
"author": "Roman Antonov (roman-rr)",
"homepage": "https://github.com/roman-rr/cupertino-pane/",
"repository": "roman-rr/cupertino-pane",
Expand Down
20 changes: 5 additions & 15 deletions src/cupertino-pane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ export class CupertinoPane {
return;
}

console.time("Presenting time");

// Emit event
this.emit('onWillPresent');

Expand All @@ -282,9 +280,6 @@ export class CupertinoPane {
Object.assign(this.paneEl.style, conf?.transition?.from);

// Show elements
// For some reason need requestAnimationFrame after show wrapper to make
// initial transition works
// TODO: resolve animation frame for transition on pane init
this.wrapperEl.style.display = 'block';
this.contentEl.style.display = 'block';
this.wrapperEl.classList.add('rendered');
Expand Down Expand Up @@ -331,14 +326,10 @@ export class CupertinoPane {

// System event
this.emit('beforePresentTransition', {animate: conf.animate});


// One frame before transition
await new Promise(resolve => requestAnimationFrame(resolve));

console.timeEnd("Presenting time");


if (conf.animate) {
await this.transitions.doTransition({
type: 'present', conf,
Expand Down Expand Up @@ -377,13 +368,12 @@ export class CupertinoPane {
}
this.overflowEl.style.overscrollBehavior = 'none';

if (this.settings.topperOverflow) {
if (this.settings.upperThanTop) {
console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"');
}

this.setOverflowHeight();
if (this.settings.topperOverflow
&& this.settings.upperThanTop) {
console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"');
}

this.setOverflowHeight();
}

public setOverflowHeight(offset = 0) {
Expand Down

0 comments on commit daa1eee

Please sign in to comment.