Skip to content

Commit

Permalink
loadMoreElementsAction (resolves #2762)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Apr 17, 2018
1 parent 55405f2 commit 6fd4791
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- The Clear Caches utility now sorts the cache options alphabetically.
- When enabling new sites for a section, the new sites’ content is now based on the primary site’s content, if the section was and still is enabled for the primary site. ([#2748](https://github.com/craftcms/cms/issues/2748))
- Improved the responsiveness of element indexes.
- `Craft.BaseElementIndexView` now has a `loadMoreElementsAction` setting. ([#2762](https://github.com/craftcms/cms/pull/2762))

### Fixed
- Fixed a bug where the Clear Caches utility was not deleting template caches. ([#2720](https://github.com/craftcms/cms/issues/2720))
Expand Down
3 changes: 2 additions & 1 deletion src/web/assets/cp/dist/js/Craft.js
Original file line number Diff line number Diff line change
Expand Up @@ -3756,7 +3756,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(

var data = this.getLoadMoreParams();

Craft.postActionRequest('element-indexes/get-more-elements', data, $.proxy(function(response, textStatus) {
Craft.postActionRequest(this.settings.loadMoreElementsAction, data, $.proxy(function(response, textStatus) {
this.loadingMore = false;
this.$loadingMoreSpinner.addClass('hidden');

Expand Down Expand Up @@ -3852,6 +3852,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
selectable: false,
multiSelect: false,
checkboxMode: false,
loadMoreElementsAction: 'element-indexes/get-more-elements',
onAppendElements: $.noop,
onSelectionChange: $.noop
}
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/web/assets/cp/src/js/BaseElementIndexView.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(

var data = this.getLoadMoreParams();

Craft.postActionRequest('element-indexes/get-more-elements', data, $.proxy(function(response, textStatus) {
Craft.postActionRequest(this.settings.loadMoreElementsAction, data, $.proxy(function(response, textStatus) {
this.loadingMore = false;
this.$loadingMoreSpinner.addClass('hidden');

Expand Down Expand Up @@ -370,6 +370,7 @@ Craft.BaseElementIndexView = Garnish.Base.extend(
selectable: false,
multiSelect: false,
checkboxMode: false,
loadMoreElementsAction: 'element-indexes/get-more-elements',
onAppendElements: $.noop,
onSelectionChange: $.noop
}
Expand Down

0 comments on commit 6fd4791

Please sign in to comment.