summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrhyst <rhystyers1@gmail.com>2022-10-20 17:16:30 +0100
committerBenjamin Brahmer <info@b-brahmer.de>2022-10-22 14:31:01 +0200
commit031a1726cfa4926c6250cfd8f7a55f5437ccd6a5 (patch)
treee2884a65839504a0c4b0964347f5d8b015a2ccc9
parentd18a9836561340d3b448903429d34ff7d77d2de7 (diff)
Fix NC25 UI issues
Signed-off-by: Rhys Tyers <mail@rhy.si>
-rw-r--r--css/content.css4
-rw-r--r--js/directive/NewsScroll.js17
-rw-r--r--templates/index.php5
3 files changed, 21 insertions, 5 deletions
diff --git a/css/content.css b/css/content.css
index 2e64f61bd..ed2e1c4e4 100644
--- a/css/content.css
+++ b/css/content.css
@@ -236,6 +236,10 @@
min-height: 43px;
}
+#app-content.nc-major-version-25 .compact .utils {
+ top: 0px;
+}
+
/* Only apply opacity to the util bar, not the dropdown */
#app-content .compact .utils ul {
opacity: 0.9;
diff --git a/js/directive/NewsScroll.js b/js/directive/NewsScroll.js
index 44271b72b..6fd1f1117 100644
--- a/js/directive/NewsScroll.js
+++ b/js/directive/NewsScroll.js
@@ -12,6 +12,16 @@ app.directive('newsScroll', function ($timeout, ITEM_AUTO_PAGE_SIZE,
'use strict';
var timer;
+
+ var scrollElement = function() {
+ const appContentElem = $('#app-content');
+ const majorVersion = parseInt($('#app-content').data('nc-major-version') || 0, 10);
+ if (majorVersion >= 25) {
+ return appContentElem;
+ }
+ return $('html');
+ };
+
// autopaging
var autoPage = function (limit, elem, scope) {
var counter = 0;
@@ -49,8 +59,7 @@ app.directive('newsScroll', function ($timeout, ITEM_AUTO_PAGE_SIZE,
articles.forEach(function(article) {
// distance to top + height
var distTop = article.offsetTop + article.offsetHeight;
- var scrollTop = window.pageYOffset ||
- document.documentElement.scrollTop;
+ var scrollTop = window.pageYOffset || scrollElement().scrollTop();
if (distTop < scrollTop) {
ids.push(parseInt(article.dataset.id, 10));
} else {
@@ -100,11 +109,11 @@ app.directive('newsScroll', function ($timeout, ITEM_AUTO_PAGE_SIZE,
}
};
- $(document).on('scroll', scrollHandler);
+ scrollElement().on('scroll', scrollHandler);
// remove scroll handler if element is destroyed
scope.$on('$destroy', function () {
- $(document).off('scroll', scrollHandler);
+ scrollElement().off('scroll', scrollHandler);
});
}
};
diff --git a/templates/index.php b/templates/index.php
index 9ad38a0d5..fc1f1382b 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -70,10 +70,13 @@ foreach (Plugin::getScripts() as $appName => $fileName) {
</div>
<div id="app-content"
+ class="nc-major-version-<?php print \OCP\Util::getVersion()[0] ?>"
+ data-nc-major-version="<?php print \OCP\Util::getVersion()[0] ?>"
ng-class="{
'loading-content': App.loading.isLoading('content') &&
!App.loading.isLoading('global'),
- 'explore': App.isFirstRun()
+ 'explore': App.isFirstRun(),
+
}"
tabindex="-1"
news-pull-to-refresh="showPullToRefresh">