talk-message-forms
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -21,4 +21,25 @@ (function() { | ||
attachment: T.object.isRequired, | ||
errorMessage: T.string | ||
eventBus: T.object | ||
}, | ||
getInitialState: function() { | ||
return { | ||
uploading: false | ||
}; | ||
}, | ||
componentDidMount: function() { | ||
if (this.props.eventBus != null) { | ||
if (this.props.attachment.data.fileKey == null) { | ||
this.props.eventBus.addListener('uploader/progress', this.onProgress); | ||
this.props.eventBus.addListener('uploader/complete', this.onDone); | ||
return this.props.eventBus.addListener('uploader/error', this.onDone); | ||
} | ||
} | ||
}, | ||
componentWillUnoumt: function() { | ||
if (this.props.eventBus != null) { | ||
this.props.eventBus.removeListener('uploader/progress', this.onProgress); | ||
this.props.eventBus.removeListener('uploader/complete', this.onDone); | ||
return this.props.eventBus.removeListener('uploader/error', this.onDone); | ||
} | ||
}, | ||
onClick: function() { | ||
@@ -28,9 +49,16 @@ var base; | ||
}, | ||
renderError: function() { | ||
return div({ | ||
className: 'error' | ||
}, span({ | ||
className: 'icon icon-put-back' | ||
})); | ||
onProgress: function() { | ||
if (this.isMounted()) { | ||
return this.setState({ | ||
uploading: true | ||
}); | ||
} | ||
}, | ||
onDone: function() { | ||
if (this.isMounted()) { | ||
return this.setState({ | ||
uploading: false | ||
}); | ||
} | ||
}, | ||
render: function() { | ||
@@ -56,5 +84,5 @@ var height, imageHeight, imageWidth, maxWidth, src, thumbnailUrl; | ||
}, LiteImageLoading({ | ||
onClick: this.onClick, | ||
uploading: this.state.uploading, | ||
src: src, | ||
errMsg: this.renderError() | ||
onClick: this.onClick | ||
}))); | ||
@@ -61,0 +89,0 @@ } |
(function() { | ||
require('react-lite-coder/src/index.less'); | ||
require('react-lite-misc/src/index.less'); | ||
require('teambition-icon-fonts/css/teambition-ui-icons.css'); | ||
require('react-lite-coder/src/index.less'); | ||
exports.File = require('./default/file'); | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "talk-message-forms", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "The Message Structure and Layout of jianliao.com", | ||
@@ -14,3 +14,3 @@ "main": "lib/index.js", | ||
"react-lite-coder": "^0.0.4", | ||
"react-lite-misc": "^0.0.7", | ||
"react-lite-misc": "^0.0.8", | ||
"teambition-icon-fonts": "^0.72.11", | ||
@@ -44,5 +44,6 @@ "xss": "^0.2.6" | ||
"scripts": { | ||
"prepublish": "gulp script", | ||
"build": "gulp build && gulp script", | ||
"dev": "gulp html && webpack-dev-server --hot", | ||
"prepublish": "rm -rf lib/ && gulp script", | ||
"postpublish": "gulp build && gulp rsync", | ||
"prestart": "gulp html", | ||
"start": "webpack-dev-server --hot --progress", | ||
"test": "" | ||
@@ -49,0 +50,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
33449
557
+ Addedreact-lite-misc@0.0.8(transitive)
- Removedreact-lite-misc@0.0.7(transitive)
Updatedreact-lite-misc@^0.0.8