if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
var list = document.querySelectorAll('.hover');
Array.prototype.forEach.call(list, function (item) {
// do something
});
$("form").submit(function() {
$(".buttonClass").click(function(e) {
button.getAttribute('data-url');
$(e.currentTarget).data('url');
price: "<=1000";
priceFrom: 1000
setTimeout(function() {
if ($(e.target).data('redirect')) {
window.location.href = 'your_url';
} else {
th.trigger("reset");
}
}, 1000);
<button data-redirect=true>Send form</button>
cd /usr/local/lib/node_modules
ls -a /usr/local/lib/node_modules
import { injectGlobal } from 'styled-components';
import { normalize } from 'polished';
const applyGlobalStyles = () => injectGlobal`
${normalize()}
`;
export default applyGlobalStyles;
import * as React from 'react';
import styled from 'styled-components';
import { Map } from "immutable";
import { withRaven } from 'app-lib/index';
const Wrapper: any = styled.div`
display: flex;
align-items: center;
width:100%;
font-family: ${props => props.theme.serifFamily};
`;
const PreviewWrapper: any = styled.a`
display: inline-block;
margin-left: 24px;
`;
const Preview = styled.div`
width: 160px;
height: 100px;
background-image: url(${(props: { src: string }) => props.src});
background-position: center center;
background-size: cover;
`;
const A: any = styled.a`
color: ${props => props.theme.linkColor};
font-size: 32px;
font-style: italic;
line-height: 36px;
`;
interface Props {
data: Map<any, any>
}
interface State {}
class Link extends React.Component<Props, State> {
static displayName = 'Link';
shouldComponentUpdate(nextProps: Props, nextState: State) {
return nextProps.data !== this.props.data;
}
@withRaven
render() {
const { data } = this.props;
const link = data.get('url');
const url = link.get('url');
const title = link.get('title');
const image = link.get('image');
return (
<Wrapper>
<A href={url}>{title}</A>
{image && (
<PreviewWrapper href={url}>
<Preview src={image} />
</PreviewWrapper>
)}
</Wrapper>
);
}
}
export default Link;
а если нет ни пагинации, ни скролла