make linter happy

This commit is contained in:
Jeff Wong 2018-12-11 09:41:15 -08:00
parent 0f734e2ae2
commit d2569f8e77
5 changed files with 22 additions and 16 deletions

View File

@ -125,7 +125,9 @@ export default Ember.Component.extend(PanEvents, {
const $timelineContainer = $(".timeline-container");
const maxOffset = parseInt($timelineContainer.css("height"), 10);
this._shouldPanClose(event) ? (offset += SWIPE_VELOCITY) : (offset -= SWIPE_VELOCITY);
this._shouldPanClose(event)
? (offset += SWIPE_VELOCITY)
: (offset -= SWIPE_VELOCITY);
$timelineContainer.css("bottom", -offset);
if (offset > maxOffset) {
@ -133,15 +135,16 @@ export default Ember.Component.extend(PanEvents, {
} else if (offset <= 0) {
$timelineContainer.css("bottom", "");
} else {
Ember.run.later(
() => this._handlePanDone(offset, event),
20
);
Ember.run.later(() => this._handlePanDone(offset, event), 20);
}
},
_shouldPanClose(e) {
return (e.deltaY > SWIPE_DISTANCE_THRESHOLD && e.velocityY > -SWIPE_VELOCITY_THRESHOLD) || e.velocityY > SWIPE_VELOCITY_THRESHOLD;
return (
(e.deltaY > SWIPE_DISTANCE_THRESHOLD &&
e.velocityY > -SWIPE_VELOCITY_THRESHOLD) ||
e.velocityY > SWIPE_VELOCITY_THRESHOLD
);
},
panStart(e) {

View File

@ -440,19 +440,23 @@ export default createWidget("header", {
toggleBodyScrolling(bool) {
if (!this.site.mobileView) return;
if (bool) {
document.body.addEventListener("touchmove", this.preventDefault, { passive: false });
document.body.addEventListener("touchmove", this.preventDefault, {
passive: false
});
} else {
document.body.removeEventListener("touchmove", this.preventDefault, { passive: false });
document.body.removeEventListener("touchmove", this.preventDefault, {
passive: false
});
}
},
preventDefault(e) {
// prevent all scrollin on menu panels, except on overflow
const height = window.innerHeight
? window.innerHeight
: $(window).height();
if (!$(e.target).parents(".menu-panel").length ||
$(".menu-panel .panel-body-contents").height() <= height) {
const height = window.innerHeight ? window.innerHeight : $(window).height();
if (
!$(e.target).parents(".menu-panel").length ||
$(".menu-panel .panel-body-contents").height() <= height
) {
e.preventDefault();
}
},

View File

@ -15,4 +15,3 @@
transition: opacity 0.2s ease-out;
}
}