mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 01:50:07 +00:00
more tuning...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a2913d7731
commit
044df2e013
@ -1303,11 +1303,16 @@ var Outline = {
|
||||
function(evt){
|
||||
var elem = evt.target
|
||||
// correct offset in editor...
|
||||
if(elem.classList.contains('code') && document.activeElement !== elem){
|
||||
if(elem.classList.contains('code')
|
||||
&& document.activeElement !== elem){
|
||||
evt.preventDefault()
|
||||
var view = that.get(elem).querySelector('.view')
|
||||
var c = getCharOffset(view, evt.clientX, evt.clientY)
|
||||
if(c != null){
|
||||
evt.preventDefault()
|
||||
if(c == null){
|
||||
elem.focus()
|
||||
elem.selectionStart = elem.value.length
|
||||
elem.selectionEnd = elem.value.length
|
||||
} else {
|
||||
var m = getMarkdownOffset(elem.value, view.innerText, c)
|
||||
elem.focus()
|
||||
elem.selectionStart = c + m
|
||||
|
||||
@ -49,7 +49,7 @@ var setup = function(){
|
||||
-
|
||||
- ## ToDo:
|
||||
- DONE click to select/edit node must retain click position in text...
|
||||
- _...needs more testing..._
|
||||
- _...need a bit of tuning -- where in the char a click is made and where the cursor is placed..._
|
||||
- ASAP: scroll into view is bad...
|
||||
- ASAP: mobile browsers behave quite chaotically ignoring parts of the styling...
|
||||
- FEATURE: read-only mode
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user