Rename hasNext to hasNextPage and hasPrevious to hasPreviousPage#148
Conversation
|
Can you delegate You can read the CONTRIBUTING.md file to find out how to run the tests and other issues on your TODO list. |
|
Any progress on this PR? |
|
Sorry, I totally forgot about this. I will probably handle it tonight. |
|
Pinging @vrinek |
|
Pong! Sorry for not updating here. I tried to get the tests running but after npm install I didn't have a grunt executable (expected it to work like ruby's bundler). I tried briefly to figure out why but failed. I'll give it another try today. |
|
LOL. You need to globally include grunt-cli with |
|
Ok, I got |
|
Hmm, how should I emit the deprecated warning? |
|
Yeah really no need to do anything besides updating the code and tests. Yes console.warn should be sufficient. Make sure you detect the existence of console and console.warn. |
|
Apart from the delegation + warnings, I also duplicated the tests of |
There was a problem hiding this comment.
I think that since this is an example, it should be up to date with the non-deprecated functions. Are you sure it should be reverted to use the has* functions?
There was a problem hiding this comment.
Yes. It will be updated in the backgrid paginator project
Sent from my iPhone
On 24 Feb, 2014, at 5:46 pm, Kostas Karachalios notifications@github.com wrote:
In examples/js/extensions/paginator/backgrid-paginator.js:
@@ -166,8 +166,8 @@
var pageIndex = this.pageIndex;if (this.isRewind && currentPage == state.firstPage ||
this.isBack && !collection.hasPrevious() ||this.isForward && !collection.hasNext() ||this.isBack && !collection.hasPreviousPage() || I think that since this is an example, it should be up to date with the non-deprecated functions. Are you sure it should be reverted to use the has* functions?this.isForward && !collection.hasNextPage() || this.isFastForward && (currentPage == state.lastPage || state.totalPages < 1)) {—
Reply to this email directly or view it on GitHub.
|
On second thought, there's no need to touch the tests either. The tests are implicitly testing the deprecated and new methods already. |
|
Ok, I'll revert the tests to their earlier form. |
There was a problem hiding this comment.
This will throw a ReferenceError. Use typeof console != 'undefined'
|
Btw, the tests output is mudded up by the deprecation warnings: https://travis-ci.org/backbone-paginator/backbone-pageable/builds/19485314 |
|
That's fine. Just revert the examples. |
Rename hasNext to hasNextPage and hasPrevious to hasPreviousPage
I noticed a disparity between
getNextPageandhasNextfunctions. I hope that with this fix, they will look a little more symmetrical.Still TODO (I will need some help with these):
has*tohas*Pagehas*