Returns the DOM element of the block.
let instance = this.app.block.get();
let $block = instance.getBlock();
$block.css('color', 'red');
Returns the type of the block.
let instance = this.app.block.get();
let type = instance.getType();
Returns the tag of the block.
let instance = this.app.block.get();
let tag = instance.getTag();
Returns content of the block.
let instance = this.app.block.get();
let content = instance.getContent();
Returns JSON of the block.
let instance = this.app.block.get();
let data = instance.getJson();
Returns properties of the block.
let instance = this.app.block.get();
let data = instance.getData();
Returns id attribute of the block.
let instance = this.app.block.get();
let id = instance.getId();
Returns the instance of the next block after the current one.
let instance = this.app.block.get();
let nextInstance = instance.getNext();
Returns the instance of the previous block before the current one.
let instance = this.app.block.get();
let prevInstance = instance.getPrev();
Sets the properties in the block.
let instance = this.app.block.get();
instance.setData({
id: 'myid'
});
Sets content to the block.
let instance = this.app.block.get();
instance.setContent('my content');
Sets the ID attribute to the block.
let instance = this.app.block.get();
instance.setId('myid');
Makes the block empty.
let instance = this.app.block.get();
instance.setEmpty();
type | String , Array |
Checks the type of the block.
let instance = this.app.block.get();
if (instance.isType('text')) { ... }
if (instance.isType(['heading', 'heading'])) { ... }
Checks if the block empty.
let instance = this.app.block.get();
let is = instance.isEmpty();
Checks if the block editable.
let instance = this.app.block.get();
let is = instance.isEditable();
Checks if the entire contents of the block is selected.
let instance = this.app.block.get();
let is = instance.isAllSelected();
Checks if the caret at the beginning of the editable block.
let instance = this.app.block.get();
let is = instance.isCaretStart();
Checks if the caret at the end of the editable block.
let instance = this.app.block.get();
let is = instance.isCaretEnd();