Commit 22e3c496 authored by JC Brand's avatar JC Brand

Terminology fix

parent e1762a1b
...@@ -1102,7 +1102,7 @@ converse.plugins.add('converse-chatview', { ...@@ -1102,7 +1102,7 @@ converse.plugins.add('converse-chatview', {
textarea.value = ''; textarea.value = '';
textarea.value = existing+value+' '; textarea.value = existing+value+' ';
} }
u.putCurserAtEnd(textarea); u.placeCaretAtEnd(textarea);
}, },
createEmojiPicker () { createEmojiPicker () {
......
...@@ -348,11 +348,11 @@ u.getCurrentWord = function (input, index) { ...@@ -348,11 +348,11 @@ u.getCurrentWord = function (input, index) {
}; };
u.replaceCurrentWord = function (input, new_value) { u.replaceCurrentWord = function (input, new_value) {
const cursor = input.selectionEnd || undefined, const caret = input.selectionEnd || undefined,
current_word = _.last(input.value.slice(0, cursor).split(' ')), current_word = _.last(input.value.slice(0, caret).split(' ')),
value = input.value; value = input.value;
input.value = value.slice(0, cursor - current_word.length) + `${new_value} ` + value.slice(cursor); input.value = value.slice(0, caret - current_word.length) + `${new_value} ` + value.slice(caret);
input.selectionEnd = cursor - current_word.length + new_value.length + 1; input.selectionEnd = caret - current_word.length + new_value.length + 1;
}; };
u.triggerEvent = function (el, name, type="Event", bubbles=true, cancelable=true) { u.triggerEvent = function (el, name, type="Event", bubbles=true, cancelable=true) {
...@@ -433,7 +433,7 @@ u.getRandomInt = function (max) { ...@@ -433,7 +433,7 @@ u.getRandomInt = function (max) {
return Math.floor(Math.random() * Math.floor(max)); return Math.floor(Math.random() * Math.floor(max));
}; };
u.putCurserAtEnd = function (textarea) { u.placeCaretAtEnd = function (textarea) {
if (textarea !== document.activeElement) { if (textarea !== document.activeElement) {
textarea.focus(); textarea.focus();
} }
......
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