Browse Source

update badge number utils

pull/565/head
jljsj 9 years ago
parent
commit
b08513a082
  1. 2
      components/badge/demo/change.md
  2. 4
      components/badge/utils.js

2
components/badge/demo/change.md

@ -13,7 +13,7 @@ const ButtonGroup = Button.Group;
const Test = React.createClass({ const Test = React.createClass({
getInitialState() { getInitialState() {
return { return {
count: 5, count: 19,
show: true, show: true,
}; };
}, },

4
components/badge/utils.js

@ -37,7 +37,7 @@ export function getTranslateY(count, preCount, data, preData, j, height, _length
if (count > preCount) { if (count > preCount) {
if (on > to) { if (on > to) {
translateY = -(oneData - (to - on)) * height; translateY = -(oneData - (to - on)) * height;
if (typeof preOn === 'number') { if (typeof preOn === 'number' && preTo - preOn > 1) {
data[(_length - j) + '_add'] = true; data[(_length - j) + '_add'] = true;
} }
} else if (on < to) { } else if (on < to) {
@ -54,7 +54,7 @@ export function getTranslateY(count, preCount, data, preData, j, height, _length
} else if (count < preCount) { } else if (count < preCount) {
if (on < to) { if (on < to) {
translateY = -(oneData + 20 - ( to - on)) * height; translateY = -(oneData + 20 - ( to - on)) * height;
if (typeof preTo === 'number') { if (typeof preTo === 'number' && preOn - preTo > 1) {
data[(_length - j) + '_rem'] = true; data[(_length - j) + '_rem'] = true;
} }
} else if (on > to) { } else if (on > to) {

Loading…
Cancel
Save