tweak dl bbcode in expanded autocomplete a bit more
This commit is contained in:
parent
4560298b98
commit
b35e69273d
@ -143,10 +143,11 @@ function listNewLineAutocomplete(id) {
|
|||||||
if (word != null) {
|
if (word != null) {
|
||||||
var textBefore = text.value.substring(0, caretPos);
|
var textBefore = text.value.substring(0, caretPos);
|
||||||
var textAfter = text.value.substring(caretPos, text.length);
|
var textAfter = text.value.substring(caretPos, text.length);
|
||||||
var textInsert = (word.indexOf('[/dl]') > 0) ? '\r\n[*= ' : '\r\n[*] ';
|
var textInsert = (word.indexOf('[/dl]') > 0) ? '\r\n[*=] ' : '\r\n[*] ';
|
||||||
|
var caretPositionDiff = (word.indexOf('[/dl]') > 0) ? 3 : 1;
|
||||||
|
|
||||||
$('#' + id).val(textBefore + textInsert + textAfter);
|
$('#' + id).val(textBefore + textInsert + textAfter);
|
||||||
setCaretPosition(text, caretPos + (textInsert.length - 1));
|
setCaretPosition(text, caretPos + (textInsert.length - caretPositionDiff));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user