Terminology fix
This commit is contained in:
parent
e1762a1bb5
commit
22e3c49660
|
@ -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) {
|
||||||
};
|
};
|
||||||
|
|
||||||
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) {
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user