fix the build

fix the build

From 98354bd34c7a639db9fb6398fa2dca8fc1d4c236 Mon Sep 17 00:00:00 2001
From: Joe <33972521+hnb-ku@users.noreply.github.com>
Date: Fri, 23 Nov 2018 11:27:59 +0800
Subject: [PATCH] fix the build


diff --git a/app/assets/javascripts/discourse/components/topic-progress.js.es6 b/app/assets/javascripts/discourse/components/topic-progress.js.es6
index 5705b73..a8370c0 100644
--- a/app/assets/javascripts/discourse/components/topic-progress.js.es6
+++ b/app/assets/javascripts/discourse/components/topic-progress.js.es6
@@ -180,24 +180,22 @@ export default Ember.Component.extend({
     }
 
     // switch mobile scroll logo at the very bottom of topics
-
-    // 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 (this.site.mobileView) {
+      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);
+      }
     }
   },

GitHub

2 Likes