Fixing list edition on rich editor
parent
5eb173d9cf
commit
5ba8d3a60e
|
@ -184,7 +184,12 @@ MarkitupDirective = ($rootscope, $rs, $selectedText, $template, $compile, $trans
|
|||
replaceWith: () -> "\n"
|
||||
afterInsert: (data) ->
|
||||
lines = data.textarea.value.split("\n")
|
||||
# Detect if we are in this situation +- aa at the beginning if the textarea
|
||||
if data.caretPosition > 0
|
||||
cursorLine = data.textarea.value[0..(data.caretPosition - 1)].split("\n").length
|
||||
else
|
||||
cursorLine = 1
|
||||
|
||||
newLineContent = data.textarea.value[data.caretPosition..].split("\n")[0]
|
||||
lastLine = lines[cursorLine - 1]
|
||||
|
||||
|
|
Loading…
Reference in New Issue