Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit a1f7166

Browse files
author
stephaneDiot
committed
Fix EZP-26997: Finder gradual loading fix
1 parent de1a31c commit a1f7166

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

Resources/public/js/views/universaldiscovery/ez-universaldiscoveryfinderexplorerlevelview.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview', function (Y) {
5050
}
5151
});
5252
this.on('itemsChange', function () {
53-
if (this.get('items')) {
54-
this.get('container').addClass(IS_LOADING);
55-
} else {
56-
this._watchingScroll = true;
57-
container.removeClass(IS_LOADING);
58-
}
53+
this._watchingScroll = true;
54+
container.removeClass(IS_LOADING);
5955
});
6056
this.after('offsetChange', function () {
6157
this._watchingScroll = false;

Tests/js/views/universaldiscovery/assets/ez-universaldiscoveryfinderexplorerlevelview-tests.js

+10-14
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,15 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
311311
Assert.areSame(this.view.get('items')[0].contentType, this.result.contentType, 'item should have a location');
312312
Assert.areSame(this.view.get('items')[0].contentInfo, this.result.location.get('contentInfo'), 'item should have a location');
313313
},
314+
315+
"Should remove loading after updating items": function () {
316+
var container = this.view.get('container');
317+
318+
container.addClass('is-loading');
319+
this.view.set('items', this.searchResult);
320+
321+
Assert.isFalse(container.hasClass('is-loading'), 'Should have the loading icon');
322+
},
314323
});
315324

316325
scrollTest = new Y.Test.Case({
@@ -451,24 +460,11 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
451460
delete this.view;
452461
},
453462

454-
"Should set items to null and add loading class on reset": function () {
455-
var container = this.view.get('container');
456-
463+
"Should set items to null on reset": function () {
457464
this.view.set('items', this.searchResult);
458465
this.view.reset();
459-
Assert.isTrue(container.hasClass('is-loading'), 'Should have the loading icon');
460466
Assert.isNull(this.view.get('items'), 'items attribute should be resetted');
461467
},
462-
463-
"Should add loading class when setting items to null": function () {
464-
var container = this.view.get('container');
465-
466-
this.view.set('items', this.searchResult);
467-
Assert.isFalse(container.hasClass('is-loading'), 'Should NOT have the loading icon');
468-
469-
this.view.set('items', null);
470-
Assert.isTrue(container.hasClass('is-loading'), 'Should have the loading icon');
471-
},
472468
});
473469

474470
Y.Test.Runner.setName("eZ Universal Discovery Finder Explorer Level View tests");

0 commit comments

Comments
 (0)