bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-23 16:47:19 +03:00
parent 5c28b8d10e
commit fbd55abddf
3 changed files with 14 additions and 5 deletions

View File

@ -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...

View File

@ -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,

View File

@ -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: