> 0.5%, last 2 versions, Firefox ESR, not dead
onChangePicture = e =>
this.setState(
{ data: { ...this.state.data, [e.target.name]: e.target.files[0] } },
this.onSubmit
);
onSubmit = e => {
if (e) e.preventDefault();
const errors = this.validate(this.state.data);
this.setState({ errors });
if (Object.keys(errors).length === 0) {
this.setState({ loading: true });
this.props.submit(this.state.data);
}
};
class Parent extends React.Component {
state = {
inputFoo: '',
inputBaz: ''
};
handleChangeInput = (inputName, value) => {
this.setState({
[inputName]: value
})
}
render() {
const { inputFoo, inputBaz } = this.state;
return (
<div>
<Children1
inputFoo={inputFoo}
inputBaz={inputBaz}
onChangeInput={this.handleChangeInput}
/>
<Children2
inputFoo={inputFoo}
inputBaz={inputBaz}
/>
</div>
);
}
}
class Chidlren1 extends React.Component {
handleInputChange = event => {
const {name, value} = event.target
this.props.onChangeInput(name, value);
}
render() {
const { inputFoo, inputBaz } = this.props;
return (
<div>
<input
type="text"
name="inputFoo"
value={inputFoo}
onChange={this.handleChangeInput}
/>
<input
type="text"
name="inputBaz"
value={inputBaz}
onChange={this.handleChangeInput}
/>
</div>
);
}
}
$ purifycss
usage: purifycss <css> <content> [option ...]
options:
--min Minify CSS
--out [filepath] Filepath to write purified CSS to
--info Logs info on how much CSS was removed
--rejected Logs the CSS rules that were removed
-h, --help Prints help (this message) and exits
headers: { accept: 'application/json', 'accept-charset': 'utf-8' }
schema.index({post_id: 1, idGroup: 1}, {unique: true});
$( window ).on("load", function() {
// your code here...
})
module.exports = {
entry: "./server.js",
output: {
path: __dirname,
filename: "dist.js"
},
module : {
loaders: [ {
test : /.js$/,
loader : 'babel-loader'
}
]
}
};
jQuery(function ($) {
if (window.location.hash) {
var target = window.location.hash;
// убираем хеш из строки(отключаем дефолтный "прыжок")
history.replaceState("", document.title, window.location.pathname
+ window.location.search);
// анимируем скролл
var target_offset = $(target).offset() ? $(target).offset().top : 0;
var customoffset = 85;
$('html, body').animate({
scrollTop: target_offset - customoffset
},500);
}
$("#.menu a[href^='#']").on('click', function(e) {
e.preventDefault();
var target = this.hash;
var target_offset = $(target).offset() ? $(target).offset().top : 0;
var customoffset = 85;
$('html, body').animate({
scrollTop: target_offset - customoffset
}, 500, function(){
});
});
});