mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-30 02:20:08 +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){
|
function(evt){
|
||||||
var elem = evt.target
|
var elem = evt.target
|
||||||
// correct offset in editor...
|
// 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 view = that.get(elem).querySelector('.view')
|
||||||
var c = getCharOffset(view, evt.clientX, evt.clientY)
|
var c = getCharOffset(view, evt.clientX, evt.clientY)
|
||||||
if(c != null){
|
if(c == null){
|
||||||
evt.preventDefault()
|
elem.focus()
|
||||||
|
elem.selectionStart = elem.value.length
|
||||||
|
elem.selectionEnd = elem.value.length
|
||||||
|
} else {
|
||||||
var m = getMarkdownOffset(elem.value, view.innerText, c)
|
var m = getMarkdownOffset(elem.value, view.innerText, c)
|
||||||
elem.focus()
|
elem.focus()
|
||||||
elem.selectionStart = c + m
|
elem.selectionStart = c + m
|
||||||
|
|||||||
@ -49,7 +49,7 @@ var setup = function(){
|
|||||||
-
|
-
|
||||||
- ## ToDo:
|
- ## ToDo:
|
||||||
- DONE click to select/edit node must retain click position in text...
|
- 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: scroll into view is bad...
|
||||||
- ASAP: mobile browsers behave quite chaotically ignoring parts of the styling...
|
- ASAP: mobile browsers behave quite chaotically ignoring parts of the styling...
|
||||||
- FEATURE: read-only mode
|
- FEATURE: read-only mode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user