Skip to content

Commit

Permalink
Merge branch '1.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbieniek committed Sep 17, 2018
2 parents 842e43f + 693e4a4 commit f76478a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Resources/public/js/apps/ez-platformuiapp.js
Expand Up @@ -1228,6 +1228,19 @@ YUI.add('ez-platformuiapp', function (Y) {
routingEnabled: {
value: true,
},

/**
* Boolean that determine if by default document should be scrolled to top on navigation
*
* @attribute scrollToTopDefault
* @default true
* @readOnly
* @type {Boolean}
*/
scrollToTopDefault: {
readOnly: true,
value: true,
},
}
});
});
9 changes: 9 additions & 0 deletions Resources/public/js/views/services/ez-searchviewservice.js
Expand Up @@ -22,9 +22,18 @@ YUI.add('ez-searchviewservice', function (Y) {

Y.eZ.SearchViewService = Y.Base.create('searchViewService', Y.eZ.ViewService, [], {
initializer: function () {
var app = this.get('app');

this.on('*:searchRequest', function(e) {
// Setting scrollToTop to false, so requesting more results won't scroll back to top of the page.
app.set('scrollToTop', false);
this._navigateToDoSearch(e);
});

this.on('*:destroy', function() {
// Returning scrollToTop to previous value.
app.set('scrollToTop', app.get('scrollToTopDefault'));
});
},

/**
Expand Down

0 comments on commit f76478a

Please sign in to comment.