mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
notes + minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6674ece80e
commit
34756613a4
@ -29,6 +29,8 @@ function clickPoint(x,y){
|
||||
// box corresponds the to desired coordinates. This accounts for nested
|
||||
// elements.
|
||||
//
|
||||
// XXX with multi-line text when clicking outside the text to the left/right
|
||||
// need to select the appropriate line...
|
||||
// XXX it would be a better idea to do a binary search instead of a liner
|
||||
// pass...
|
||||
// ...though b-search will get us to the target, we stll need to count...
|
||||
|
||||
@ -180,7 +180,6 @@ HTMLTextAreaElement.prototype.getTextOffsetAt = function(x, y){
|
||||
r.setEnd(t, i)
|
||||
prev = rect
|
||||
rect = r.getBoundingClientRect()
|
||||
|
||||
// line change...
|
||||
if(prev && prev.y != rect.y){
|
||||
// went off the cursor line
|
||||
@ -192,21 +191,21 @@ HTMLTextAreaElement.prototype.getTextOffsetAt = function(x, y){
|
||||
?? i - 1 }
|
||||
// reset col
|
||||
col = undefined }
|
||||
|
||||
// cursor line...
|
||||
cursor_line =
|
||||
oy >= rect.y - clone.y
|
||||
&& oy <= rect.bottom - clone.y
|
||||
|
||||
// cursor col -- set once per line...
|
||||
if(col == null
|
||||
&& ox <= rect.x - clone.x){
|
||||
col = (!prev
|
||||
|| Math.abs(rect.x - clone.x - x) <= Math.abs(prev.x - clone.x - x)) ?
|
||||
// XXX not sure about this test...
|
||||
col = (ox > 0
|
||||
|| i == 0) ?
|
||||
i
|
||||
: i - 1
|
||||
if(cursor_line){
|
||||
return col } } }
|
||||
// below or right of the block -> return last col or last char...
|
||||
return col
|
||||
?? i }
|
||||
|
||||
|
||||
@ -56,13 +56,9 @@ var setup = function(){
|
||||
- side margins are a bit too large (account for toolbat to the right)
|
||||
-
|
||||
- ## ToDo:
|
||||
- DONE selecting expanded code by _click-n-drag_
|
||||
- # this is a test
|
||||
string with
|
||||
some extra words
|
||||
- BUG: while selecting if the cursor moves to the left far enough (outside parent?) the first char in current line gets toggled...
|
||||
- custom element / web component
|
||||
- BUG: select via click-n-drag and double/triple clicks does not work...
|
||||
- BUG: select via double/triple clicks does not work...
|
||||
- _looks like something is refocusing the element..._
|
||||
- BUG/race: the non-value versions of custom elem seem to sometimes get loaded as empty...
|
||||
- DONE data interface:
|
||||
collapsed:: true
|
||||
@ -126,6 +122,11 @@ var setup = function(){
|
||||
- `<editable/>` -- field marker
|
||||
- each child node will copy the template and allow editing of only fields
|
||||
- not clear how to handle template changes...
|
||||
- DONE selecting expanded code by _click-n-drag_
|
||||
collapsed:: true
|
||||
- # this is a test
|
||||
string with
|
||||
some extra words
|
||||
- DONE `backspace`/`delete` in block contract the field with a delay...
|
||||
collapsed:: true
|
||||
- _...looks like we are updating size on keyup..._
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user