diff options
Diffstat (limited to 'public/js/Input.js')
| -rw-r--r-- | public/js/Input.js | 12 |
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 | ||
| 77 | class InputTextSocialNetwork extends InputText{ | 77 | class 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 | ||
