Comparing version 1.0.1 to 1.0.2
@@ -74,3 +74,16 @@ "use strict"; | ||
var getClassNames = this.getClassNames(allItemsClassName); | ||
function getClassNames(allItemsClassName, thisItemClassName) { | ||
return function (thisItemClassName) { | ||
var ret = ""; | ||
if (allItemsClassName) { | ||
ret += allItemsClassName; | ||
} | ||
if (thisItemClassName) { | ||
ret += " "; | ||
ret += thisItemClassName; | ||
} | ||
return ret; | ||
}; | ||
} | ||
var classnames = getClassNames(allItemsClassName); | ||
@@ -86,3 +99,3 @@ var paginationInfo = new _paginator2["default"](itemsCountPerPage, pageRangeDisplayed).build(totalItemsCount, activePage); | ||
onClick: this.props.onChange, | ||
className: getClassNames(pagesClassName), | ||
className: classnames(pagesClassName), | ||
activeClassName: activeClassName | ||
@@ -99,3 +112,3 @@ })); | ||
pageText: prevPageText, | ||
className: getClassNames(prevPageClassName) | ||
className: classnames(prevPageClassName) | ||
})); | ||
@@ -109,3 +122,3 @@ | ||
pageText: firstPageText, | ||
className: getClassNames(firstPageClassName) | ||
className: classnames(firstPageClassName) | ||
})); | ||
@@ -119,3 +132,3 @@ | ||
pageText: nextPageText, | ||
className: getClassNames(nextPageClassName) | ||
className: classnames(nextPageClassName) | ||
})); | ||
@@ -129,3 +142,3 @@ | ||
pageText: lastPageText, | ||
className: getClassNames(lastPageClassName) | ||
className: classnames(lastPageClassName) | ||
})); | ||
@@ -132,0 +145,0 @@ |
{ | ||
"name": "paginorm", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Simple, easy to use component for pagination. Compatible with bootstrap paginator stylesheets", | ||
@@ -73,2 +73,4 @@ "main": "./dist/Pagination.js", | ||
"mocha": "^2.4.5", | ||
"react-dom": "^15.0.0", | ||
"react": "^15.0.0", | ||
"react-addons-test-utils": "^0.14.7 || ^15.0.1", | ||
@@ -75,0 +77,0 @@ "react-transform-catch-errors": "^1.0.0", |
@@ -35,3 +35,3 @@ /*eslint-env node, mocha */ | ||
it("renders an element as a child if passed an one", () => { | ||
it("renders an element as a li > a child if passed an one", () => { | ||
const child = <strong>1</strong>; | ||
@@ -48,4 +48,4 @@ const context = { | ||
const result = Page.prototype.render.call(context); | ||
expect(result.type).toBe("strong"); | ||
expect(result.type).toBe("li"); | ||
}); | ||
}); |
@@ -82,3 +82,17 @@ import React, { Component, PropTypes } from "react"; | ||
const getClassNames = this.getClassNames(allItemsClassName); | ||
function getClassNames(allItemsClassName, thisItemClassName) { | ||
return function(thisItemClassName) { | ||
let ret = ""; | ||
if (allItemsClassName) { | ||
ret += allItemsClassName; | ||
} | ||
if (thisItemClassName) { | ||
ret += " "; | ||
ret += thisItemClassName; | ||
} | ||
return ret; | ||
}; | ||
} | ||
const classnames = getClassNames(allItemsClassName); | ||
@@ -96,3 +110,3 @@ const paginationInfo = new pagiator(itemsCountPerPage, pageRangeDisplayed) | ||
onClick={this.props.onChange} | ||
className={getClassNames(pagesClassName)} | ||
className={classnames(pagesClassName)} | ||
activeClassName={activeClassName} | ||
@@ -111,3 +125,3 @@ /> | ||
pageText={prevPageText} | ||
className={getClassNames(prevPageClassName)} | ||
className={classnames(prevPageClassName)} | ||
/> | ||
@@ -123,3 +137,3 @@ ); | ||
pageText={firstPageText} | ||
className={getClassNames(firstPageClassName)} | ||
className={classnames(firstPageClassName)} | ||
/> | ||
@@ -135,3 +149,3 @@ ); | ||
pageText={nextPageText} | ||
className={getClassNames(nextPageClassName)} | ||
className={classnames(nextPageClassName)} | ||
/> | ||
@@ -147,3 +161,3 @@ ); | ||
pageText={lastPageText} | ||
className={getClassNames(lastPageClassName)} | ||
className={classnames(lastPageClassName)} | ||
/> | ||
@@ -150,0 +164,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1311795
1895
45