adapt-authoring-ui 1.8.4 → 1.8.5

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.
@@ -1,6 +1,5 @@
1
1
  // LICENCE https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE
2
2
  define(function(require){
3
- var CourseModel = require('core/models/courseModel');
4
3
  var Origin = require('core/origin');
5
4
  var OriginView = require('core/views/originView');
6
5
  var ProjectView = require('./projectView');
@@ -90,23 +89,7 @@ define(function(require){
90
89
  },
91
90
 
92
91
  initPaging: function() {
93
- if(this.resizeTimer) {
94
- clearTimeout(this.resizeTimer);
95
- this.resizeTimer = -1;
96
- }
97
- var $item = new ProjectView({ model: new CourseModel() }).$el;
98
- $item.css({
99
- visibility: 'hidden'
100
- }).appendTo('.projects-list'); // Fixed: added missing class selector
101
-
102
- var containerHeight = $(window).height()-this.$el.offset().top;
103
- var itemHeight = $item.outerHeight(true);
104
- var columns = Math.floor(this.$('.projects-inner').width()/$item.outerWidth(true));
105
- var rows = Math.max(1, Math.ceil(containerHeight/itemHeight));
106
- $item.remove();
107
- // columns stack nicely, but need to add extra row if it's not a clean split
108
- if((containerHeight % itemHeight) > 0) rows++;
109
- this.collection.queryOptions.limit = columns*rows;
92
+ this.collection.queryOptions.limit = 20;
110
93
  this.resetCollection(this.setViewToReady);
111
94
  },
112
95
 
@@ -205,16 +188,16 @@ define(function(require){
205
188
  checkAndFillVisibleArea: function() {
206
189
  // Check if we need to load more items to fill the viewport
207
190
  if(this.shouldStopFetches || this.isCollectionFetching) return;
208
-
191
+
209
192
  const $last = $('.project-list-item').last();
210
193
  if($last.length === 0) return;
211
-
212
- const contentPane = $('.contentPane');
213
- if(contentPane.length === 0) return;
214
-
215
- const contentPaneBottom = contentPane.offset().top + contentPane.height();
216
- const lastItemBottom = $last.offset().top + $last.height();
217
-
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
+
218
201
  // If the last item is visible (within the viewport), fetch more
219
202
  if(lastItemBottom <= contentPaneBottom) {
220
203
  this.fetchCollection();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-ui",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
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",