Renamed PagedCollectionPresenter to PagerPresenter

This commit is contained in:
Marcin Kurczewski 2014-10-01 23:22:20 +02:00
parent 14325b4338
commit da41fd7a96
5 changed files with 12 additions and 13 deletions

1
TODO
View file

@ -26,7 +26,6 @@ everything related to posts:
- single post view
- previous and next post (difficult)
- rename PagedCollectionPresenter to PagerPresenter
- remember last search
- take care of pages
- add A/D hotkeys

View file

@ -79,7 +79,7 @@
<script type="text/javascript" src="/js/PresenterManager.js"></script>
<script type="text/javascript" src="/js/Presenters/TopNavigationPresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/PagedCollectionPresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/PagerPresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/MessagePresenter.js"></script>
<script type="text/javascript" src="/js/Presenters/LoginPresenter.js"></script>

View file

@ -1,7 +1,7 @@
var App = App || {};
App.Presenters = App.Presenters || {};
App.Presenters.PagedCollectionPresenter = function(
App.Presenters.PagerPresenter = function(
_,
jQuery,
util,
@ -208,4 +208,4 @@ App.Presenters.PagedCollectionPresenter = function(
};
App.DI.register('pagedCollectionPresenter', ['_', 'jQuery', 'util', 'promise', 'api', 'keyboard', 'router', 'pager', 'presenterManager', 'browsingSettings'], App.Presenters.PagedCollectionPresenter);
App.DI.register('pagerPresenter', ['_', 'jQuery', 'util', 'promise', 'api', 'keyboard', 'router', 'pager', 'presenterManager', 'browsingSettings'], App.Presenters.PagerPresenter);

View file

@ -9,7 +9,7 @@ App.Presenters.PostListPresenter = function(
auth,
router,
keyboard,
pagedCollectionPresenter,
pagerPresenter,
topNavigationPresenter,
messagePresenter) {
@ -31,7 +31,7 @@ App.Presenters.PostListPresenter = function(
render();
loaded();
pagedCollectionPresenter.init({
pagerPresenter.init({
baseUri: '#/posts',
backendUri: '/posts',
$target: $el.find('.pagination-target'),
@ -54,7 +54,7 @@ App.Presenters.PostListPresenter = function(
loaded();
var searchArgs = util.parseComplexRouteArgs(args.searchArgs);
pagedCollectionPresenter.reinit({page: searchArgs.page, searchParams: {query: searchArgs.query, order: searchArgs.order}});
pagerPresenter.reinit({page: searchArgs.page, searchParams: {query: searchArgs.query, order: searchArgs.order}});
}
function render() {
@ -90,4 +90,4 @@ App.Presenters.PostListPresenter = function(
};
App.DI.register('postListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'router', 'keyboard', 'pagedCollectionPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.PostListPresenter);
App.DI.register('postListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'router', 'keyboard', 'pagerPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.PostListPresenter);

View file

@ -7,7 +7,7 @@ App.Presenters.UserListPresenter = function(
util,
promise,
auth,
pagedCollectionPresenter,
pagerPresenter,
topNavigationPresenter,
messagePresenter) {
@ -29,7 +29,7 @@ App.Presenters.UserListPresenter = function(
render();
loaded();
pagedCollectionPresenter.init({
pagerPresenter.init({
baseUri: '#/users',
backendUri: '/users',
$target: $el.find('.pagination-target'),
@ -55,7 +55,7 @@ App.Presenters.UserListPresenter = function(
searchArgs.order = searchArgs.order || 'name,asc';
updateActiveOrder(searchArgs.order);
pagedCollectionPresenter.reinit({
pagerPresenter.reinit({
page: searchArgs.page,
searchParams: {
order: searchArgs.order}});
@ -93,7 +93,7 @@ App.Presenters.UserListPresenter = function(
e.preventDefault();
var $orderLink = jQuery(this);
var activeSearchOrder = $orderLink.attr('data-order');
pagedCollectionPresenter.setSearchParams({order: activeSearchOrder});
pagerPresenter.setSearchParams({order: activeSearchOrder});
}
return {
@ -104,4 +104,4 @@ App.Presenters.UserListPresenter = function(
};
App.DI.register('userListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'pagedCollectionPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.UserListPresenter);
App.DI.register('userListPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'pagerPresenter', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.UserListPresenter);