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