Parcourir la source

#2005 Mobile Apps Module: disable pull to refresh in messenger

Alex Trofimov il y a 7 ans
Parent
commit
eb88f3c06f
1 fichiers modifiés avec 12 ajouts et 8 suppressions
  1. 12 8
      modules/boonex/mobile_apps/template/mobile_apps_js.html

+ 12 - 8
modules/boonex/mobile_apps/template/mobile_apps_js.html

@@ -65,13 +65,17 @@
 
     // pull to refresh
     $(document).ready(function () {
-        PullToRefresh.init({
-            instructionsPullToRefresh: '__txt_pull_to_refresh__',
-            instructionsReleaseToRefresh: '__txt_release_to_refresh__',
-            instructionsRefreshing: '__txt_refreshing__',
-            onRefresh() {
-                window.location.reload();
-            },
-        });
+        if ($('.bx-messenger-block-lots').length)
+            glBxMobileDisablePullToRefresh = true;
+        if ('undefined' === typeof glBxMobileDisablePullToRefresh || false === glBxMobileDisablePullToRefresh) {
+            PullToRefresh.init({
+                instructionsPullToRefresh: '__txt_pull_to_refresh__',
+                instructionsReleaseToRefresh: '__txt_release_to_refresh__',
+                instructionsRefreshing: '__txt_refreshing__',
+                onRefresh() {
+                    window.location.reload();
+                },
+            });
+        }
     });
 </script>