aboutsummaryrefslogtreecommitdiff
path: root/public/js/Input.js
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-10-29 12:08:28 +0100
committerpolo <ordipolo@gmx.fr>2025-10-29 12:08:28 +0100
commit822f526fd7f4e89043e64b435961720b622bdb6e (patch)
tree2c4bb2a653052f9dc76858db2a2f9f1d0d0a031a /public/js/Input.js
parentf653506421ee8e2c46c78e93d28ee2418a1d399d (diff)
downloadcms-822f526fd7f4e89043e64b435961720b622bdb6e.tar.gz
cms-822f526fd7f4e89043e64b435961720b622bdb6e.tar.bz2
cms-822f526fd7f4e89043e64b435961720b622bdb6e.zip
gestion réseaux sociaux présents/absents, partie 1
Diffstat (limited to 'public/js/Input.js')
-rw-r--r--public/js/Input.js12
1 files changed, 10 insertions, 2 deletions
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{
76 76
77class InputTextSocialNetwork extends InputText{ 77class InputTextSocialNetwork extends InputText{
78 open(){ 78 open(){
79 this.input_elem.value = this.content_elem.parentNode.href; 79 const elem_parent = this.content_elem.parentNode;
80 if(elem_parent.tagName.toLowerCase() === 'a'){
81 this.input_elem.value = elem_parent.href;
82 }
80 super.open(); 83 super.open();
81 } 84 }
82 onSuccess(data){ 85 onSuccess(data){
83 this.content_elem.parentNode.href = this.input_elem.value; 86 if(this.input_elem.value){
87 this.content_elem.parentNode.href = this.input_elem.value;
88 }
89 else{
90 this.content_elem.parentNode.removeAttribute('href');
91 }
84 } 92 }
85} 93}
86 94