Merge pull request #8315 from open-sausages/pulls/4.2/changing-change

FIX Paginating a gridfield causing a change event
This commit is contained in:
Daniel Hensby 2018-08-20 17:59:50 +01:00 committed by GitHub
commit aa153cb5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -245,7 +245,7 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
} else { } else {
// First page button // First page button
$firstPage = new GridField_FormAction($gridField, 'pagination_first', 'First', 'paginate', 1); $firstPage = new GridField_FormAction($gridField, 'pagination_first', 'First', 'paginate', 1);
$firstPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-double-left ss-gridfield-firstpage'); $firstPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-double-left ss-gridfield-pagination-action ss-gridfield-firstpage');
if ($state->currentPage == 1) { if ($state->currentPage == 1) {
$firstPage = $firstPage->performDisabledTransformation(); $firstPage = $firstPage->performDisabledTransformation();
} }
@ -259,7 +259,7 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
'paginate', 'paginate',
$previousPageNum $previousPageNum
); );
$previousPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-left ss-gridfield-previouspage'); $previousPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-left ss-gridfield-pagination-action ss-gridfield-previouspage');
if ($state->currentPage == 1) { if ($state->currentPage == 1) {
$previousPage = $previousPage->performDisabledTransformation(); $previousPage = $previousPage->performDisabledTransformation();
} }
@ -273,14 +273,14 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
'paginate', 'paginate',
$nextPageNum $nextPageNum
); );
$nextPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-right ss-gridfield-nextpage'); $nextPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-right ss-gridfield-pagination-action ss-gridfield-nextpage');
if ($state->currentPage == $totalPages) { if ($state->currentPage == $totalPages) {
$nextPage = $nextPage->performDisabledTransformation(); $nextPage = $nextPage->performDisabledTransformation();
} }
// Last page button // Last page button
$lastPage = new GridField_FormAction($gridField, 'pagination_last', 'Last', 'paginate', $totalPages); $lastPage = new GridField_FormAction($gridField, 'pagination_last', 'Last', 'paginate', $totalPages);
$lastPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-double-right ss-gridfield-lastpage'); $lastPage->addExtraClass('btn btn-secondary btn--hide-text btn-sm font-icon-angle-double-right ss-gridfield-pagination-action ss-gridfield-lastpage');
if ($state->currentPage == $totalPages) { if ($state->currentPage == $totalPages) {
$lastPage = $lastPage->performDisabledTransformation(); $lastPage = $lastPage->performDisabledTransformation();
} }