From 822f526fd7f4e89043e64b435961720b622bdb6e Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 29 Oct 2025 12:08:28 +0100 Subject: =?UTF-8?q?gestion=20r=C3=A9seaux=20sociaux=20pr=C3=A9sents/absent?= =?UTF-8?q?s,=20partie=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/Input.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'public/js') diff --git a/public/js/Input.js b/public/js/Input.js index 6c5af10..54872d1 100644 --- a/public/js/Input.js +++ b/public/js/Input.js @@ -76,11 +76,19 @@ class InputText extends InputToggler{ class InputTextSocialNetwork extends InputText{ open(){ - this.input_elem.value = this.content_elem.parentNode.href; + const elem_parent = this.content_elem.parentNode; + if(elem_parent.tagName.toLowerCase() === 'a'){ + this.input_elem.value = elem_parent.href; + } super.open(); } onSuccess(data){ - this.content_elem.parentNode.href = this.input_elem.value; + if(this.input_elem.value){ + this.content_elem.parentNode.href = this.input_elem.value; + } + else{ + this.content_elem.parentNode.removeAttribute('href'); + } } } -- cgit v1.2.3