adapt-authoring-ui 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -185,33 +185,24 @@ define(function(require){
|
|
|
185
185
|
});
|
|
186
186
|
},
|
|
187
187
|
|
|
188
|
+
isNearListBottom: function(buffer) {
|
|
189
|
+
const cp = $('.contentPane')[0];
|
|
190
|
+
if(!cp) return false;
|
|
191
|
+
return cp.scrollHeight - cp.scrollTop - cp.clientHeight <= buffer;
|
|
192
|
+
},
|
|
193
|
+
|
|
188
194
|
checkAndFillVisibleArea: function() {
|
|
189
|
-
//
|
|
195
|
+
// Trigger another fetch when current items don't overflow the viewport
|
|
190
196
|
if(this.shouldStopFetches || this.isCollectionFetching) return;
|
|
191
|
-
|
|
192
|
-
const $last = $('.project-list-item').last();
|
|
193
|
-
if($last.length === 0) return;
|
|
194
|
-
|
|
195
|
-
const $contentPane = $('.contentPane');
|
|
196
|
-
if($contentPane.length === 0) return;
|
|
197
|
-
|
|
198
|
-
const contentPaneBottom = $contentPane.scrollTop() + $contentPane.height();
|
|
199
|
-
const lastItemBottom = $last.position().top + $last.outerHeight(true);
|
|
200
|
-
|
|
201
|
-
// If the last item is visible (within the viewport), fetch more
|
|
202
|
-
if(lastItemBottom <= contentPaneBottom) {
|
|
203
|
-
this.fetchCollection();
|
|
204
|
-
}
|
|
197
|
+
if(this.isNearListBottom(0)) this.fetchCollection();
|
|
205
198
|
},
|
|
206
199
|
|
|
207
|
-
doLazyScroll: function(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if($last.offset().top < triggerY) this.fetchCollection();
|
|
200
|
+
doLazyScroll: function() {
|
|
201
|
+
// Trigger when user scrolls within one viewport of the bottom
|
|
202
|
+
if(this.isCollectionFetching || this.shouldStopFetches) return;
|
|
203
|
+
const cp = $('.contentPane')[0];
|
|
204
|
+
if(!cp) return;
|
|
205
|
+
if(this.isNearListBottom(cp.clientHeight)) this.fetchCollection();
|
|
215
206
|
},
|
|
216
207
|
|
|
217
208
|
doLayout: function(layout) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Front-end application for the Adapt authoring tool",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-ui",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
22
22
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
23
23
|
"@rollup/plugin-terser": "^1.0.0",
|
|
24
|
-
"adapt-authoring-core": "^
|
|
24
|
+
"adapt-authoring-core": "^3.0.0",
|
|
25
25
|
"babel-plugin-transform-amd-to-es6": "^1.0.2",
|
|
26
26
|
"cpy": "^13.0.0",
|
|
27
27
|
"fs-extra": "^11.2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"upath": "^2.0.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"adapt-authoring-adaptframework": "^
|
|
40
|
+
"adapt-authoring-adaptframework": "^3.0.0",
|
|
41
41
|
"adapt-authoring-authored": "^1.4.0",
|
|
42
42
|
"adapt-authoring-content": "^3.0.0",
|
|
43
43
|
"adapt-authoring-server": "^2.0.0"
|