make linter happy
This commit is contained in:
parent
0f734e2ae2
commit
d2569f8e77
|
@ -125,7 +125,9 @@ export default Ember.Component.extend(PanEvents, {
|
||||||
const $timelineContainer = $(".timeline-container");
|
const $timelineContainer = $(".timeline-container");
|
||||||
const maxOffset = parseInt($timelineContainer.css("height"), 10);
|
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);
|
$timelineContainer.css("bottom", -offset);
|
||||||
if (offset > maxOffset) {
|
if (offset > maxOffset) {
|
||||||
|
@ -133,15 +135,16 @@ export default Ember.Component.extend(PanEvents, {
|
||||||
} else if (offset <= 0) {
|
} else if (offset <= 0) {
|
||||||
$timelineContainer.css("bottom", "");
|
$timelineContainer.css("bottom", "");
|
||||||
} else {
|
} else {
|
||||||
Ember.run.later(
|
Ember.run.later(() => this._handlePanDone(offset, event), 20);
|
||||||
() => this._handlePanDone(offset, event),
|
|
||||||
20
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_shouldPanClose(e) {
|
_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) {
|
panStart(e) {
|
||||||
|
|
|
@ -440,19 +440,23 @@ export default createWidget("header", {
|
||||||
toggleBodyScrolling(bool) {
|
toggleBodyScrolling(bool) {
|
||||||
if (!this.site.mobileView) return;
|
if (!this.site.mobileView) return;
|
||||||
if (bool) {
|
if (bool) {
|
||||||
document.body.addEventListener("touchmove", this.preventDefault, { passive: false });
|
document.body.addEventListener("touchmove", this.preventDefault, {
|
||||||
|
passive: false
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
document.body.removeEventListener("touchmove", this.preventDefault, { passive: false });
|
document.body.removeEventListener("touchmove", this.preventDefault, {
|
||||||
|
passive: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
preventDefault(e) {
|
preventDefault(e) {
|
||||||
// prevent all scrollin on menu panels, except on overflow
|
// prevent all scrollin on menu panels, except on overflow
|
||||||
const height = window.innerHeight
|
const height = window.innerHeight ? window.innerHeight : $(window).height();
|
||||||
? window.innerHeight
|
if (
|
||||||
: $(window).height();
|
!$(e.target).parents(".menu-panel").length ||
|
||||||
if (!$(e.target).parents(".menu-panel").length ||
|
$(".menu-panel .panel-body-contents").height() <= height
|
||||||
$(".menu-panel .panel-body-contents").height() <= height) {
|
) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,4 +15,3 @@
|
||||||
transition: opacity 0.2s ease-out;
|
transition: opacity 0.2s ease-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue