From 4d2ebb1020377a87734717e2ac6e0389a2fd4b91 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Fri, 4 Nov 2022 18:19:32 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=8F=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B0=D0=B9=D1=82=D0=B8,=20=D0=B5=D1=81=D0=BB=D0=B8?= =?UTF-8?q?=20=D1=84=D0=BB=D0=B0=D0=B6=D0=BE=D0=BA=20=D0=B1=D0=B5=D0=B7=20?= =?UTF-8?q?=D0=B3=D0=B0=D0=BB=D0=BE=D1=87=D0=BA=D0=B8=20#128?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/js/markup/trust_props.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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); + } + }); }