Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Fixed paging issue caused by Dribbble's JSON serving page number as s…
Browse files Browse the repository at this point in the history
…tring
  • Loading branch information
Marius Stuparu committed Jun 5, 2014
1 parent 1723383 commit 3965c40
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dribbble.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ function pregame(name, path) {
} catch(e) {}

if (
typeof body.pages === 'number' &&
typeof body.page === 'number'
// Dribbble's JSON object has the current page as string
typeof parseInt(body.pages) === 'number' &&
typeof parseInt(body.page) === 'number'
) {
if (body.page < body.pages) {
if (parseInt(body.page) < parseInt(body.pages)) {
options = options || {}

paging.next = function(callback) {
Expand Down Expand Up @@ -143,4 +144,4 @@ function pregame(name, path) {
court.prototype[definition.name] = pregame(definition.name, definition.path)
})

module.exports = court
module.exports = court

0 comments on commit 3965c40

Please sign in to comment.