Artur Galyamov
2 years ago
1 changed files with 13 additions and 2 deletions
@ -1,5 +1,16 @@ |
|||||||
export function initMarkupTrustProps() { |
export function initMarkupTrustProps() { |
||||||
|
const renderSearchLink = (trustPropName) => { |
||||||
|
const safeName = trustPropName.replace(' ', '+'); |
||||||
|
return` <a target="blank" href="/explore/competences?tab=&q=${safeName}" rel="nofollow">найти</a>`; |
||||||
|
} |
||||||
|
|
||||||
$('.trust-props input[type="checkbox"]').click((e) => { |
$('.trust-props input[type="checkbox"]').click((e) => { |
||||||
$(e.target).parent().find('a').remove() |
if (e.target.checked) { |
||||||
}) |
$(e.target).parent().find('a').remove(); |
||||||
|
} else { |
||||||
|
const $parent = $(e.target).parent(); |
||||||
|
const renderedSearchLink = renderSearchLink($parent.text()); |
||||||
|
$parent.append(renderedSearchLink); |
||||||
|
} |
||||||
|
}); |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue