Commit adb92a2e authored by JC Brand's avatar JC Brand

Two small UX fixes

- Don't close the emojis panel after inserting an emoji.
- Focus the message textarea when the emojis panel is opened or closed.
parent 691c4846
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
- Don't hang indefinitely and provide nicer error messages when a connection - Don't hang indefinitely and provide nicer error messages when a connection
can't be established. can't be established.
- Consolidate error and validation reporting on the registration form. - Consolidate error and validation reporting on the registration form.
- Don't close the emojis panel after inserting an emoji.
- Focus the message textarea when the emojis panel is opened or closed.
### Technical changes ### Technical changes
- Converse.js now includes a [Virtual DOM](https://github.com/Matt-Esch/virtual-dom) - Converse.js now includes a [Virtual DOM](https://github.com/Matt-Esch/virtual-dom)
......
...@@ -8,7 +8,7 @@ msgstr "" ...@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Converse.js 0.4\n" "Project-Id-Version: Converse.js 0.4\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-24 10:57+0200\n" "POT-Creation-Date: 2017-09-24 10:57+0200\n"
"PO-Revision-Date: 2017-09-24 11:04+0200\n" "PO-Revision-Date: 2017-11-12 19:56+0100\n"
"Last-Translator: JC Brand <jc@opkode.com>\n" "Last-Translator: JC Brand <jc@opkode.com>\n"
"Language-Team: Afrikaans <https://hosted.weblate.org/projects/conversejs/" "Language-Team: Afrikaans <https://hosted.weblate.org/projects/conversejs/"
"translations/af/>\n" "translations/af/>\n"
...@@ -230,7 +230,7 @@ msgstr "Hangende kontakte" ...@@ -230,7 +230,7 @@ msgstr "Hangende kontakte"
#: dist/converse-no-dependencies.js:15199 #: dist/converse-no-dependencies.js:15199
msgid "Contact requests" msgid "Contact requests"
msgstr "Kontak versoeke" msgstr "Kontakversoeke"
#: dist/converse-no-dependencies.js:15200 #: dist/converse-no-dependencies.js:15200
msgid "Ungrouped" msgid "Ungrouped"
......
...@@ -1055,9 +1055,9 @@ ...@@ -1055,9 +1055,9 @@
} }
}, },
"backbone.vdomview": { "backbone.vdomview": {
"version": "0.0.1", "version": "0.0.2",
"resolved": "https://registry.npmjs.org/backbone.vdomview/-/backbone.vdomview-0.0.1.tgz", "resolved": "https://registry.npmjs.org/backbone.vdomview/-/backbone.vdomview-0.0.2.tgz",
"integrity": "sha512-wmOKebp5tKLXFOWVmexDDST93BhmjbjTkssXit/6cmz1+eC3ryMR0azSxIIeJcXF66k3QDJLlgq3oFHmnTU4yw==", "integrity": "sha512-rQtR1DvE6aiSUSa4VbF2jELu+uutBoQ692/W2fdcwd+SyMpG5DumCEIf5mjZG6z0+Fq2TWFM4IPTv1il4iqO6w==",
"dev": true, "dev": true,
"requires": { "requires": {
"backbone": "1.3.3", "backbone": "1.3.3",
......
...@@ -767,7 +767,6 @@ ...@@ -767,7 +767,6 @@
insertEmoji (ev) { insertEmoji (ev) {
ev.stopPropagation(); ev.stopPropagation();
this.toggleEmojiMenu();
const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target; const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target;
this.insertIntoTextArea(target.getAttribute('data-emoji')); this.insertIntoTextArea(target.getAttribute('data-emoji'));
}, },
...@@ -785,12 +784,11 @@ ...@@ -785,12 +784,11 @@
document.querySelectorAll('.toolbar-menu'), document.querySelectorAll('.toolbar-menu'),
[this.emoji_picker_view.el] [this.emoji_picker_view.el]
); );
utils.slideInAllElements(elements).then( utils.slideInAllElements(elements)
_.partial( .then(_.partial(
utils.slideToggleElement, utils.slideToggleElement,
this.emoji_picker_view.el this.emoji_picker_view.el))
) .then(this.focus.bind(this));
);
}, },
toggleCall (ev) { toggleCall (ev) {
...@@ -913,7 +911,7 @@ ...@@ -913,7 +911,7 @@
}, },
focus () { focus () {
this.$el.find('.chat-textarea').focus(); this.el.querySelector('.chat-textarea').focus();
_converse.emit('chatBoxFocused', this); _converse.emit('chatBoxFocused', this);
return this; return this;
}, },
......
...@@ -256,11 +256,11 @@ ...@@ -256,11 +256,11 @@
clearFilter (ev) { clearFilter (ev) {
if (ev && ev.preventDefault) { if (ev && ev.preventDefault) {
ev.preventDefault(); ev.preventDefault();
$(ev.target).removeClass('x onX').val(''); ev.target.classList.remove('x');
ev.target.classList.remove('onX');
ev.target.value = '';
} }
this.model.save({ this.model.save({'filter_text': ''});
'filter_text': ''
});
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment