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

Fix EZP-26997: Finder gradual loading fix #806

Merged
merged 1 commit into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview', function (Y) {
}
});
this.on('itemsChange', function () {
if (this.get('items')) {
this.get('container').addClass(IS_LOADING);
} else {
this._watchingScroll = true;
container.removeClass(IS_LOADING);
}
this._watchingScroll = true;
container.removeClass(IS_LOADING);
});
this.after('offsetChange', function () {
this._watchingScroll = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
Assert.areSame(this.view.get('items')[0].contentType, this.result.contentType, 'item should have a location');
Assert.areSame(this.view.get('items')[0].contentInfo, this.result.location.get('contentInfo'), 'item should have a location');
},

"Should remove loading after updating items": function () {
var container = this.view.get('container');

container.addClass('is-loading');
this.view.set('items', this.searchResult);

Assert.isFalse(container.hasClass('is-loading'), 'Should have the loading icon');
},
});

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

"Should set items to null and add loading class on reset": function () {
var container = this.view.get('container');

"Should set items to null on reset": function () {
this.view.set('items', this.searchResult);
this.view.reset();
Assert.isTrue(container.hasClass('is-loading'), 'Should have the loading icon');
Assert.isNull(this.view.get('items'), 'items attribute should be resetted');
},

"Should add loading class when setting items to null": function () {
var container = this.view.get('container');

this.view.set('items', this.searchResult);
Assert.isFalse(container.hasClass('is-loading'), 'Should NOT have the loading icon');

this.view.set('items', null);
Assert.isTrue(container.hasClass('is-loading'), 'Should have the loading icon');
},
});

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