Skip to content

Commit

Permalink
Fix ViewSwitcher component & airbnb example
Browse files Browse the repository at this point in the history
  • Loading branch information
metagrover committed Mar 20, 2017
1 parent 1aa133d commit f950ba0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions app/actuators/ResultCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,18 @@ export default class ResultCard extends Component {
}

applyScroll() {
const resultElement = $(".rbc-resultcard-container");
const scrollElement = $(".rbc-resultcard-scroll-container");
const resultElement = $(this.listParentElement);
const scrollElement = $(this.listChildElement);
const padding = 45;

function checkHeight() {
const flag = resultElement.get(0).scrollHeight - padding > resultElement.height();
const scrollFlag = scrollElement.get(0).scrollHeight > scrollElement.height();
if (!flag && !scrollFlag && scrollElement.length) {
scrollElement.css("height", resultElement.height() - 100);
const scrollHeight = resultElement.height() - 100;
if (scrollHeight > 0) {
scrollElement.css("height", scrollHeight);
}
}
}

Expand Down
9 changes: 6 additions & 3 deletions app/actuators/ResultList.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,18 @@ export default class ResultList extends Component {
}

applyScroll() {
const resultElement = $(".rbc-resultlist-container");
const scrollElement = $(".rbc-resultlist-scroll-container");
const resultElement = $(this.listParentElement);
const scrollElement = $(this.listChildElement);
const padding = 45;

function checkHeight() {
const flag = resultElement.get(0).scrollHeight - padding > resultElement.height();
const scrollFlag = scrollElement.get(0).scrollHeight > scrollElement.height();
if (!flag && !scrollFlag && scrollElement.length) {
scrollElement.css("height", resultElement.height() - 100);
const scrollHeight = resultElement.height() - 100;
if (scrollHeight > 0) {
scrollElement.css("height", scrollHeight);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/airbnb/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Main extends Component {
onPopoverTrigger={this.onPopoverTrigger}
defaultZoom={15}
size={60}
center={{ lat: 47.6062, lng: -122.3321 }}
defaultCenter={{ lat: 47.6062, lng: -122.3321 }}
react={{
and: ["PlaceSensor", "PriceSensor"]
}}
Expand Down

0 comments on commit f950ba0

Please sign in to comment.