mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-22 02:51:38 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5c28b8d10e
commit
fbd55abddf
@ -1051,6 +1051,7 @@ var Outline = {
|
|||||||
|
|
||||||
|
|
||||||
// crop...
|
// crop...
|
||||||
|
// XXX add crop/path indicator...
|
||||||
__crop_stack: undefined,
|
__crop_stack: undefined,
|
||||||
crop: function(node='focused'){
|
crop: function(node='focused'){
|
||||||
var stack = this.__crop_stack ??= []
|
var stack = this.__crop_stack ??= []
|
||||||
@ -1328,6 +1329,7 @@ var Outline = {
|
|||||||
cur[place](block)
|
cur[place](block)
|
||||||
: undefined }
|
: undefined }
|
||||||
return block },
|
return block },
|
||||||
|
// XXX see inside...
|
||||||
load: function(data){
|
load: function(data){
|
||||||
var that = this
|
var that = this
|
||||||
data = typeof(data) == 'string' ?
|
data = typeof(data) == 'string' ?
|
||||||
@ -1348,9 +1350,12 @@ var Outline = {
|
|||||||
.clear()
|
.clear()
|
||||||
.outline
|
.outline
|
||||||
.append(...level(data))
|
.append(...level(data))
|
||||||
|
//* XXX do we actually need this???
|
||||||
// update sizes of all the textareas (transparent)...
|
// update sizes of all the textareas (transparent)...
|
||||||
for(var e of [...this.outline.querySelectorAll('textarea')]){
|
setTimeout(function(){
|
||||||
e.updateSize() }
|
for(var e of [...that.outline.querySelectorAll('textarea')]){
|
||||||
|
e.updateSize() } }, 0)
|
||||||
|
//*/
|
||||||
// restore focus...
|
// restore focus...
|
||||||
this.focus()
|
this.focus()
|
||||||
return this },
|
return this },
|
||||||
@ -1374,7 +1379,6 @@ var Outline = {
|
|||||||
right: function(){},
|
right: function(){},
|
||||||
|
|
||||||
// XXX move the code here into methods/actions...
|
// XXX move the code here into methods/actions...
|
||||||
// XXX add scrollIntoView(..) to nav...
|
|
||||||
// XXX use keyboard.js...
|
// XXX use keyboard.js...
|
||||||
keyboard: {
|
keyboard: {
|
||||||
// vertical navigation...
|
// vertical navigation...
|
||||||
@ -1397,7 +1401,7 @@ var Outline = {
|
|||||||
var edited = this.get('edited')
|
var edited = this.get('edited')
|
||||||
if(edited){
|
if(edited){
|
||||||
var {line, lines} = edited.getTextGeometry()
|
var {line, lines} = edited.getTextGeometry()
|
||||||
if(line == lines -1){
|
if(line == lines - 1){
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
that.focus('edited', 'next') }
|
that.focus('edited', 'next') }
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -75,9 +75,12 @@ HTMLTextAreaElement.prototype.getTextGeometry = function(){
|
|||||||
|
|
||||||
document.body.append(span)
|
document.body.append(span)
|
||||||
|
|
||||||
|
var padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)
|
||||||
var res = {
|
var res = {
|
||||||
length: text.length,
|
length: text.length,
|
||||||
lines: Math.floor(this.offsetHeight / carret.offsetHeight),
|
lines: Math.floor(
|
||||||
|
(this.offsetHeight - padding)
|
||||||
|
/ carret.offsetHeight),
|
||||||
line: Math.floor(carret.offsetTop / carret.offsetHeight),
|
line: Math.floor(carret.offsetTop / carret.offsetHeight),
|
||||||
offset: offset,
|
offset: offset,
|
||||||
offsetLeft: carret.offsetLeft,
|
offsetLeft: carret.offsetLeft,
|
||||||
|
|||||||
@ -40,6 +40,7 @@ var setup = function(){
|
|||||||
- Logseq
|
- Logseq
|
||||||
- Conboy (Nokia N900's Tomboy clone)
|
- Conboy (Nokia N900's Tomboy clone)
|
||||||
- Bonsai (on PalmOS)
|
- Bonsai (on PalmOS)
|
||||||
|
- Google Keep
|
||||||
-
|
-
|
||||||
- // Seems that I unintentionally implemented quite a chunk of the markdown spec ;)
|
- // Seems that I unintentionally implemented quite a chunk of the markdown spec ;)
|
||||||
-
|
-
|
||||||
@ -245,6 +246,7 @@ var setup = function(){
|
|||||||
- z
|
- z
|
||||||
- c
|
- c
|
||||||
- > quote
|
- > quote
|
||||||
|
id::quote-example
|
||||||
- Notes
|
- Notes
|
||||||
- NOTE: a note text
|
- NOTE: a note text
|
||||||
- NOTE:
|
- NOTE:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user