adapt-authoring-ui 1.8.3 → 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.
|
@@ -55,9 +55,8 @@ define(function(require){
|
|
|
55
55
|
|
|
56
56
|
$.post(`${this.model.url()}/update`)
|
|
57
57
|
.done(function() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
this.model.fetch();
|
|
58
|
+
this.model.set({ canBeUpdated: false });
|
|
59
|
+
this.render();
|
|
61
60
|
}.bind(this))
|
|
62
61
|
.fail(function(e) {
|
|
63
62
|
$btn.attr('title', Origin.l10n.t('app.updatefailed'));
|
|
@@ -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
|
-
|
|
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.
|
|
216
|
-
const lastItemBottom = $last.
|
|
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