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

Commit c151747

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

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
@@ -312,6 +312,15 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
312312
Assert.areSame(this.view.get('items')[0].contentType, this.result.contentType, 'item should have a location');
313313
Assert.areSame(this.view.get('items')[0].contentInfo, this.result.location.get('contentInfo'), 'item should have a location');
314314
},
315+
316+
"Should remove loading after updating items": function () {
317+
var container = this.view.get('container');
318+
319+
container.addClass('is-loading');
320+
this.view.set('items', this.searchResult);
321+
322+
Assert.isFalse(container.hasClass('is-loading'), 'Should have the loading icon');
323+
},
315324
});
316325

317326
scrollTest = new Y.Test.Case({
@@ -462,24 +471,11 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
462471
delete this.view;
463472
},
464473

465-
"Should set items to null and add loading class on reset": function () {
466-
var container = this.view.get('container');
467-
474+
"Should set items to null on reset": function () {
468475
this.view.set('items', this.searchResult);
469476
this.view.reset();
470-
Assert.isTrue(container.hasClass('is-loading'), 'Should have the loading icon');
471477
Assert.isNull(this.view.get('items'), 'items attribute should be resetted');
472478
},
473-
474-
"Should add loading class when setting items to null": function () {
475-
var container = this.view.get('container');
476-
477-
this.view.set('items', this.searchResult);
478-
Assert.isFalse(container.hasClass('is-loading'), 'Should NOT have the loading icon');
479-
480-
this.view.set('items', null);
481-
Assert.isTrue(container.hasClass('is-loading'), 'Should have the loading icon');
482-
},
483479
});
484480

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

0 commit comments

Comments
 (0)