diff --git a/public/index.html b/public/index.html index 6f20d48..19ff3ed 100644 --- a/public/index.html +++ b/public/index.html @@ -367,7 +367,7 @@
-
+
diff --git a/public/scripts/ui.js b/public/scripts/ui.js index a930dd3..971b287 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -1724,7 +1724,7 @@ class SendTextDialog extends Dialog { constructor() { super('send-text-dialog'); Events.on('text-recipient', e => this._onRecipient(e.detail.peerId, e.detail.deviceName)); - this.$text = this.$el.querySelector('#text-input'); + this.$text = this.$el.querySelector('.textarea'); this.$peerDisplayName = this.$el.querySelector('.display-name'); this.$form = this.$el.querySelector('form'); this.$submit = this.$el.querySelector('button[type="submit"]'); @@ -1745,7 +1745,7 @@ class SendTextDialog extends Dialog { } _textInputEmpty() { - return !this.$text.innerText || this.$text.innerText === "\n"; + return !this.$text.value || this.$text.value === "\n"; } _onChange(e) { @@ -1767,7 +1767,6 @@ class SendTextDialog extends Dialog { const range = document.createRange(); const sel = window.getSelection(); - this.$text.focus(); range.selectNodeContents(this.$text); sel.removeAllRanges(); sel.addRange(range); @@ -1781,7 +1780,7 @@ class SendTextDialog extends Dialog { _send() { Events.fire('send-text', { to: this.correspondingPeerId, - text: this.$text.innerText + text: this.$text.value }); this.$text.value = ""; this.hide(); diff --git a/public/styles.css b/public/styles.css index 33f0811..8d232d0 100644 --- a/public/styles.css +++ b/public/styles.css @@ -1011,7 +1011,7 @@ x-dialog .dialog-subheader { padding-bottom: 0; } -#text-input { +#send-text-dialog .textarea { min-height: 200px; width: 100%; } diff --git a/public_included_ws_fallback/index.html b/public_included_ws_fallback/index.html index f2819b6..55a3a92 100644 --- a/public_included_ws_fallback/index.html +++ b/public_included_ws_fallback/index.html @@ -372,7 +372,7 @@
-
+
diff --git a/public_included_ws_fallback/scripts/ui.js b/public_included_ws_fallback/scripts/ui.js index e03c377..a8b115a 100644 --- a/public_included_ws_fallback/scripts/ui.js +++ b/public_included_ws_fallback/scripts/ui.js @@ -1726,7 +1726,7 @@ class SendTextDialog extends Dialog { constructor() { super('send-text-dialog'); Events.on('text-recipient', e => this._onRecipient(e.detail.peerId, e.detail.deviceName)); - this.$text = this.$el.querySelector('#text-input'); + this.$text = this.$el.querySelector('.textarea'); this.$peerDisplayName = this.$el.querySelector('.display-name'); this.$form = this.$el.querySelector('form'); this.$submit = this.$el.querySelector('button[type="submit"]'); @@ -1747,7 +1747,7 @@ class SendTextDialog extends Dialog { } _textInputEmpty() { - return !this.$text.innerText || this.$text.innerText === "\n"; + return !this.$text.value || this.$text.value === "\n"; } _onChange(e) { @@ -1769,7 +1769,6 @@ class SendTextDialog extends Dialog { const range = document.createRange(); const sel = window.getSelection(); - this.$text.focus(); range.selectNodeContents(this.$text); sel.removeAllRanges(); sel.addRange(range); @@ -1783,7 +1782,7 @@ class SendTextDialog extends Dialog { _send() { Events.fire('send-text', { to: this.correspondingPeerId, - text: this.$text.innerText + text: this.$text.value }); this.$text.value = ""; this.hide(); diff --git a/public_included_ws_fallback/styles.css b/public_included_ws_fallback/styles.css index 55be5c3..62e7514 100644 --- a/public_included_ws_fallback/styles.css +++ b/public_included_ws_fallback/styles.css @@ -1041,7 +1041,7 @@ x-dialog .dialog-subheader { padding-bottom: 0; } -#text-input { +#send-text-dialog .textarea { min-height: 200px; width: 100%; }