You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
export function initMarkupTrustProps() {
|
|
|
|
const renderSearchLink = (trustPropName, trustPropType) => {
|
|
|
|
const safeName = trustPropName.replace(' ', '+');
|
|
|
|
return` <a target="blank" href="/explore/${trustPropType}?tab=&q=${safeName}" rel="nofollow">найти</a>`;
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.trust-props input[type="checkbox"]').click((e) => {
|
|
|
|
if (e.target.checked) {
|
|
|
|
$(e.target).parent().find('a').remove();
|
|
|
|
} else {
|
|
|
|
const $parent = $(e.target).parent();
|
|
|
|
const $listContainer = $parent.parents("div.render-content");
|
|
|
|
const trustPropType = $listContainer.attr("data-trust-prop-type");
|
|
|
|
const renderedSearchLink = renderSearchLink($parent.text(), trustPropType);
|
|
|
|
$parent.append(renderedSearchLink);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|