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 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) {
|
||||
|
|
|
@ -327,7 +327,7 @@ export default createWidget("hamburger-menu", {
|
|||
const $centeredElement = $(document.elementFromPoint(e.clientX, e.clientY));
|
||||
if (
|
||||
$centeredElement.parents(".panel").length &&
|
||||
!$centeredElement.hasClass("header-cloak")
|
||||
!$centeredElement.hasClass("header-cloak")
|
||||
) {
|
||||
this.sendWidgetAction("toggleHamburger");
|
||||
} else {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -198,7 +198,7 @@ export default createWidget("user-menu", {
|
|||
const $centeredElement = $(document.elementFromPoint(e.clientX, e.clientY));
|
||||
if (
|
||||
$centeredElement.parents(".panel").length &&
|
||||
!$centeredElement.hasClass("header-cloak")
|
||||
!$centeredElement.hasClass("header-cloak")
|
||||
) {
|
||||
this.sendWidgetAction("toggleUserMenu");
|
||||
} else {
|
||||
|
|
|
@ -15,4 +15,3 @@
|
|||
transition: opacity 0.2s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue