Documentation

Blocks

getBlocks #

Returns all blocks in the content.

var $blocks = this.app.blocks.getBlocks();
$blocks.each(function($node) {
    var instance = $node.dataget('instance');
});

getFirstLevel #

Returns first-level blocks in the content.

var $blocks = this.app.blocks.getFirstLevel();
$blocks.each(function($node) {
    var instance = $node.dataget('instance');
});

getEditableBlocks #

Returns all editable blocks in the content.

var $blocks = this.app.blocks.getEditableBlocks();
$blocks.each(function($node) {
    var instance = $node.dataget('instance');
});

getSelected #

Returns all selected blocks.

var $blocks = this.app.blocks.getSelected();
$blocks.each(function($node) {
    var instance = $node.dataget('instance');
});

getFirst #

Returns the first block in the content.

var $block = this.app.blocks.getFirst();
var instance = $block.dataget('instance');

getFirstSelected #

Returns the first selected block.

var $block = this.app.blocks.getFirstSelected();
var instance = $block.dataget('instance');

getLast #

Returns the last block in the content.

var $block = this.app.blocks.getLast();
var instance = $block.dataget('instance');

getLastSelected #

Returns the last selected block.

var $block = this.app.blocks.getLastSelected();
var instance = $block.dataget('instance');

removeSelected #

Removes selected blocks.

this.app.blocks.removeSelected();

unset #

Unsets selected blocks.

this.app.blocks.unset();