fix the build

This commit is contained in:
Joe 2018-11-23 11:27:59 +08:00 committed by GitHub
parent c4fca36255
commit 98354bd34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 17 deletions

View File

@ -180,24 +180,22 @@ export default Ember.Component.extend({
}
// switch mobile scroll logo at the very bottom of topics
if (this.site.mobileView) {
const isIOS = this.capabilities.isIOS,
switchHeight = bodyHeight - offset - windowHeight,
appEvents = getOwner(this).lookup("app-events:main");
// not a mobile device so don't do anything
if (!this.site.mobileView) return;
const isIOS = this.capabilities.isIOS,
switchHeight = bodyHeight - offset - windowHeight,
appEvents = getOwner(this).lookup("app-events:main");
if (isIOS && switchHeight < -10) {
// match elastic-scroll behaviour in iOS
setTimeout(function() {
appEvents.trigger("header:hide-topic");
}, 300);
} else if (!isIOS && switchHeight < 5) {
// normal switch for everyone else
setTimeout(function() {
appEvents.trigger("header:hide-topic");
}, 300);
if (isIOS && switchHeight < -10) {
// match elastic-scroll behaviour in iOS
setTimeout(function() {
appEvents.trigger("header:hide-topic");
}, 300);
} else if (!isIOS && switchHeight < 5) {
// normal switch for everyone else
setTimeout(function() {
appEvents.trigger("header:hide-topic");
}, 300);
}
}
},