Comparing version 1.1.1 to 1.1.2
@@ -7,2 +7,6 @@ # Changelog | ||
## [1.1.2] - 2018-05-03 | ||
### Changed | ||
- Simplify calculation of top value | ||
## [1.1.1] - 2018-05-03 | ||
@@ -9,0 +13,0 @@ ### Added |
@@ -59,9 +59,9 @@ "use strict"; | ||
var direction = scroll - oldScroll > 0 ? 'down' : 'up'; | ||
var top = _this.state.top + oldScroll - scroll; | ||
var height = _this.internalRef.getBoundingClientRect().height; | ||
if (direction === 'down') { | ||
_this.setState({ top: Math.max(top, -height) }); | ||
var height = _this.internalRef.getBoundingClientRect().height; | ||
_this.setState({ top: -height }); | ||
} | ||
else { | ||
_this.setState({ top: Math.min(top, 0) }); | ||
var top_1 = _this.state.top + oldScroll - scroll; | ||
_this.setState({ top: Math.min(top_1, 0) }); | ||
} | ||
@@ -68,0 +68,0 @@ _this.setState({ scroll: scroll }); |
{ | ||
"name": "app-bar", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "An app bar for React that stays out of your way", | ||
@@ -5,0 +5,0 @@ "licence": "MIT", |
# app-bar | ||
[![npm](https://img.shields.io/npm/v/app-bar.svg)](https://www.npmjs.com/package/app-bar) | ||
[![Build Status](https://travis-ci.org/iiroj/app-bar.svg?branch=master)](https://travis-ci.org/iiroj/app-bar) | ||
[![Build Status](https://travis-ci.org/iiroj/app-bar.svg?branch=master)](https://travis-ci.com/iiroj/app-bar) | ||
[![GitHub issues](https://img.shields.io/github/issues-raw/iiroj/app-bar.svg)](https://github.com/iiroj/app-bar/issues) | ||
@@ -6,0 +6,0 @@ [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/iiroj/app-bar.svg)](https://github.com/iiroj/app-bar/pulls) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12633