Started working on SitesList component for accepting user input and validation.
This commit is contained in:
28
assets/js/components/SitesList.react.js
Normal file
28
assets/js/components/SitesList.react.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var React = require('react');
|
||||
|
||||
var SitesList = React.createClass({
|
||||
|
||||
getDefaultProps: function () {
|
||||
return {
|
||||
placeholder: 'http://google.com'
|
||||
};
|
||||
},
|
||||
|
||||
render: function () {
|
||||
return (
|
||||
<div className="form-group">
|
||||
<label htmlFor="sites" className="col-lg-2 control-label">{this.props.label}</label>
|
||||
|
||||
<div className="col-lg-10">
|
||||
<textarea className="form-control" rows="3" ref="sites"
|
||||
placeholder={this.props.placeholder}></textarea>
|
||||
<span className="help-block">{this.props.helpText}
|
||||
<br/>
|
||||
One line per site.</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = SitesList;
|
||||
@@ -45,7 +45,7 @@ chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
|
||||
|
||||
if (changeInfo.status === 'complete') {
|
||||
// Get current tab URL.
|
||||
chrome.tabs.query({active: true}, (tabs) => {
|
||||
chrome.tabs.query({active: true}, function(tabs) {
|
||||
// If tab updated is the same as active tab
|
||||
if (tabId == tabs[0].id) {
|
||||
console.log('recording a heartbeat - tab updated');
|
||||
|
||||
Reference in New Issue
Block a user