diff --git a/web_src/js/markup/trust_props.js b/web_src/js/markup/trust_props.js index f4ceb04470..eb5169e205 100644 --- a/web_src/js/markup/trust_props.js +++ b/web_src/js/markup/trust_props.js @@ -1,5 +1,16 @@ export function initMarkupTrustProps() { + const renderSearchLink = (trustPropName) => { + const safeName = trustPropName.replace(' ', '+'); + return` найти`; + } + $('.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); + } + }); }