react-ajaxing
Advanced tools
Comparing version 0.0.4 to 0.0.5
// Generated by CoffeeScript 1.9.3 | ||
var React; | ||
var React, objectAsign; | ||
@@ -8,11 +8,19 @@ React = require('react'); | ||
objectAsign = require('object-assign'); | ||
module.exports = React.createClass({ | ||
displayName: "ajaxing", | ||
propTypes: { | ||
loading: React.PropTypes.bool.isRequired, | ||
size: React.PropTypes.number, | ||
color: React.PropTypes.string | ||
}, | ||
getDefaultProps: function() { | ||
return { | ||
size: '20' | ||
size: 20, | ||
color: '#FFF' | ||
}; | ||
}, | ||
render: function() { | ||
var classes, style; | ||
var bounceStyle, classes, size, style; | ||
classes = 'react-ajaxing'; | ||
@@ -22,8 +30,12 @@ if (this.props.className) { | ||
} | ||
if (this.props.size) { | ||
style = { | ||
width: this.props.size + "px", | ||
height: this.props.size + "px" | ||
}; | ||
size = { | ||
width: this.props.size + "px", | ||
height: this.props.size + "px" | ||
}; | ||
if (this.props.style) { | ||
style = objectAsign(this.props.style, size); | ||
} | ||
bounceStyle = { | ||
backgroundColor: this.props.color | ||
}; | ||
if (this.props.loading) { | ||
@@ -35,7 +47,9 @@ return React.createElement("div", React.__spread({}, this.props, { | ||
"className": "ajax-double-bounce", | ||
"style": style | ||
"style": size | ||
}, React.createElement("div", { | ||
"className": "ajax-double-bounce1" | ||
"className": "ajax-double-bounce1", | ||
"style": bounceStyle | ||
}), React.createElement("div", { | ||
"className": "ajax-double-bounce2" | ||
"className": "ajax-double-bounce2", | ||
"style": bounceStyle | ||
}))); | ||
@@ -42,0 +56,0 @@ } else { |
{ | ||
"name": "react-ajaxing", | ||
"description": "tell the component ajax is sending", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": "Bingo Yang <blackbing@gmail.com>", | ||
@@ -15,3 +15,4 @@ "browserify": { | ||
"dependencies": { | ||
"cssify": "^0.7.0" | ||
"cssify": "^0.7.0", | ||
"object-assign": "^3.0.0" | ||
}, | ||
@@ -18,0 +19,0 @@ "devDependencies": { |
@@ -27,3 +27,3 @@ # react-ajaxing | ||
<button type ="submit" onClick={@login}> | ||
<Spinner loading={@state.loading} size={20}><span>Login</span></Spinner> | ||
<Spinner loading={@state.loading} size={20} color="red"><span>Login</span></Spinner> | ||
</button> | ||
@@ -36,6 +36,8 @@ ) | ||
### loading(boolean): indicate it is loading status or not | ||
### size(number): spinner size(px) | ||
default: 20 | ||
### loading(boolean): indicate it is loading status or not | ||
### color(string): spinner color | ||
default: '#FFF' |
Sorry, the diff of this file is not supported yet
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
6536
90
42
3
+ Addedobject-assign@^3.0.0
+ Addedobject-assign@3.0.0(transitive)