Skip to content

Commit

Permalink
calcFitHeight, maxFitHeight, orientationchange - issues #122 #123 #125
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Jan 21, 2021
1 parent ac23804 commit f1fd6b2
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 147 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.2.3] - 2021-01-22

### Features
- Added `.calcFitHeight()` method to re-calculate automatically height `fitHeight: true`, if this value was not proper calculated due DOM issues [#123](https://github.com/roman-rr/cupertino-pane/issues/123)
- Added `maxFitHeight` property to settings to define maximum possible automatically calculated height [#122](https://github.com/roman-rr/cupertino-pane/issues/122)

### Bug Fixes
- Switched `resize` callback to `orientationchange` callback for device orientation changes. Fixed issues regarding resize and keyboards. [#125](https://github.com/roman-rr/cupertino-pane/issues/125)

## [1.2.2] - 2021-01-20

### Features
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ new CupertinoPane(element); // HTMLElement
| **parentElement** | `string` | Parent element selector | Element selector where pane will rendered |
| **followerElement** | `string` | Follower element selector | Element with selector will following pane transitions |
| **fitHeight** | `boolean` | 'false' | Automatically calc and define content height as top breakpoint. Middle and bottom breakpoint will be disabled |
| **maxFitHeight** | `number` | 'null' | Define a maximum possible automatically calculated height with `fitHeight` property |
| **fitScreenHeight** | `boolean` | 'false' | On `true` will automatically adjust pane maximum height to screen height |
| **pushElement** | `string` | Push element selector | DOM Element will be pushed and scaled |
| **pushMinHeight** | `number` | Most bottom available point | Height from which 3d push effect will be started |
Expand Down Expand Up @@ -314,6 +315,11 @@ const myPane = new CupertinoPane('.cupertino-pane', settings);
myPane.present({animate: true});
myPane.preventDismiss(true);
```
### calcFitHeight()
Force re-calculate height for `fitHeight: true` in cases when height was calculated not properly.
```javascript
myPane.calcFitHeight();
```


## Attributes
Expand Down
2 changes: 1 addition & 1 deletion dist/breakpoints.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CupertinoPane, CupertinoSettings } from 'cupertino-pane';
import { CupertinoPane, CupertinoSettings } from './cupertino-pane';
import { PaneBreaks } from './models';
/**
* Breakpoints builde
Expand Down
3 changes: 2 additions & 1 deletion dist/cupertino-pane.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare class CupertinoPane {
preventDismissEvent: boolean;
preventedDismiss: boolean;
private iconCloseColor;
private rendered;
rendered: boolean;
wrapperEl: HTMLDivElement;
paneEl: HTMLDivElement;
overflowEl: HTMLElement;
Expand Down Expand Up @@ -82,6 +82,7 @@ export declare class CupertinoPane {
* @param conf
*/
setBreakpoints(conf?: PaneBreaks): Promise<void>;
calcFitHeight(): Promise<void>;
moveToBreak(val: string): any;
moveToHeight(val: number): any;
hide(): any;
Expand Down
51 changes: 33 additions & 18 deletions dist/cupertino-pane.esm.bundle.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.esm.bundle.js.map

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

Loading

0 comments on commit f1fd6b2

Please sign in to comment.