mirror of
https://github.com/codex-team/editor.js
synced 2024-06-17 13:15:20 +02:00
Initial
This commit is contained in:
parent
f45521df65
commit
8e80021f75
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -34,6 +34,7 @@ export default class Block {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.api = apiMethods;
|
this.api = apiMethods;
|
||||||
this.holder = this.compose();
|
this.holder = this.compose();
|
||||||
|
this.inputIndex = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {IBlockTune[]}
|
* @type {IBlockTune[]}
|
||||||
|
@ -106,6 +107,26 @@ export default class Block {
|
||||||
return this.save();
|
return this.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get inputs() {
|
||||||
|
const collection = this.holder.querySelectorAll('[contenteditable], input, textarea');
|
||||||
|
|
||||||
|
return _.array(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
get nextInput() {
|
||||||
|
const inputs = this.inputs;
|
||||||
|
|
||||||
|
this.inputIndex = Math.min(inputs.length - 1, this.inputIndex + 1);
|
||||||
|
|
||||||
|
return inputs[this.inputIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
get previousInput() {
|
||||||
|
this.inputIndex = Math.max(0, this.inputIndex - 1);
|
||||||
|
|
||||||
|
return this.inputs[this.inputIndex];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* is block mergeable
|
* is block mergeable
|
||||||
* We plugin have merge function then we call it mergable
|
* We plugin have merge function then we call it mergable
|
||||||
|
|
Loading…
Reference in a new issue