|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
export function initMarkupTrustProps() { |
|
|
|
|
const renderSearchLink = (trustPropName) => { |
|
|
|
|
const renderSearchLink = (trustPropName, trustPropType) => { |
|
|
|
|
const safeName = trustPropName.replace(' ', '+'); |
|
|
|
|
return` <a target="blank" href="/explore/competences?tab=&q=${safeName}" rel="nofollow">найти</a>`; |
|
|
|
|
return` <a target="blank" href="/explore/${trustPropType}?tab=&q=${safeName}" rel="nofollow">найти</a>`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$('.trust-props input[type="checkbox"]').click((e) => { |
|
|
|
@ -9,7 +9,9 @@ export function initMarkupTrustProps() {
|
|
|
|
|
$(e.target).parent().find('a').remove(); |
|
|
|
|
} else { |
|
|
|
|
const $parent = $(e.target).parent(); |
|
|
|
|
const renderedSearchLink = renderSearchLink($parent.text()); |
|
|
|
|
const $listContainer = $parent.parents("div.render-content"); |
|
|
|
|
const trustPropType = $listContainer.attr("data-trust-prop-type"); |
|
|
|
|
const renderedSearchLink = renderSearchLink($parent.text(), trustPropType); |
|
|
|
|
$parent.append(renderedSearchLink); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|