codex_editor | Unsorted

Telegram-канал codex_editor - Editor.js 🤩

269

Users and collaborators community Ask a question or leave a feedback about Editor.js https://github.com/codex-team/editor.js Please, write in English. 💝 Support project: http://opencollective.com/editorjs

Subscribe to a channel

Editor.js 🤩

The Plus Button opens a Toolbox. There is no Tunes, but Blocks

Читать полностью…

Editor.js 🤩

https://editorjs.io/configuration/#block-tunes-connection

Читать полностью…

Editor.js 🤩

I initiated it like this on paragraph, I assume this is my mistake, there's a way to initiate at top level? outside the tune menu?

Читать полностью…

Editor.js 🤩

https://github.com/codex-team/editor.js/blob/next/src/components/block-tunes/block-tune-delete.ts

Читать полностью…

Editor.js 🤩

alright, well now I know :) thanks man! this was driving me nuts

Читать полностью…

Editor.js 🤩

is there a reason for not having a method in the api to get the data of a block? is it pointless or so? I'm a noob

Читать полностью…

Editor.js 🤩

because one expects that the object block passed to the tune to have .data, since it already has an id

Читать полностью…

Editor.js 🤩

I saw someone elese was lost with this problem as well on stack overflow

Читать полностью…

Editor.js 🤩

it has no .data getter, but it has the ".save()" method

Читать полностью…

Editor.js 🤩

should it not have .data on it?

Читать полностью…

Editor.js 🤩

this is my tune, everything works except data is not passed to the constructor, and the block thats passed to the constructor, only has the id, no .data

Читать полностью…

Editor.js 🤩

I'm unable to get the block.data in a tune command

Читать полностью…

Editor.js 🤩

I'm not sure I'm understanding your problem.

Читать полностью…

Editor.js 🤩

is this a bug? what am I doing wrong?

Читать полностью…

Editor.js 🤩

I dont get it, the block object has no data inside the tune

Читать полностью…

Editor.js 🤩

the UI with the + for new paragrapgs and from where you open the tune menu

Читать полностью…

Editor.js 🤩

what is the "top level"?

Читать полностью…

Editor.js 🤩

how do you initate it? its showing up on the tune menu, not at top level,

Читать полностью…

Editor.js 🤩

might as well ask you something more,

I dont think there's a way to do this via the API, for instance, if I wanted to add a tune to the top level, such as the + and block seetings, like a bin so that I can delete the block from the top level, is there a way to approach this with the API? I couldnt find it

Читать полностью…

Editor.js 🤩

there is the "blocks.getById()" returning a BlockAPI. Then you can call the "save()" on it

Читать полностью…

Editor.js 🤩

ok this works, this gives me the block text

Читать полностью…

Editor.js 🤩

you don't have to loop over blocks, just call this.block.save()

Читать полностью…

Editor.js 🤩

yep, I used your strategy and it worked, but this makes me cycle trough all the blocks to get the data, wouldnt it be better to have the data passed to the tune?

Читать полностью…

Editor.js 🤩

block here is the BlockAPI: https://editorjs.io/blockapi/

Читать полностью…

Editor.js 🤩

these are all undefined, except block, but block has no .data property, only .id

Читать полностью…

Editor.js 🤩

I checked the object and its not there

Читать полностью…

Editor.js 🤩

is this the only way? Im going to try it now but this cant be right

Читать полностью…

Editor.js 🤩

so I would then have to cycle trough it to find the one with the id

Читать полностью…

Editor.js 🤩

its not passed, it passes the id but not data

Читать полностью…

Editor.js 🤩

but this gets all the blocks, it wont work, I'm trying to read a block

Читать полностью…
Subscribe to a channel