Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the result of block.call #1205

Merged
merged 33 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f5e9a66
[Improvements] ESLint action (#1099)
neSpecc Apr 11, 2020
4c0d806
[Refactor] ESLint fixed (#1100)
gohabereg Apr 18, 2020
21cac86
[Feature] i18n (#1106)
neSpecc Apr 20, 2020
775ccbc
Remove unused submodule
tasuku-s Apr 23, 2020
f4c4051
Fixed: icon centering in Firefox
neSpecc Apr 25, 2020
2997ed0
Do not load styles twice (#1112)
gohabereg Apr 25, 2020
4a81699
Show warning if Block to delete is not found (#1111)
gohabereg Apr 25, 2020
7eb642d
Save Tools' order in the Toolbox (#1113)
gohabereg Apr 25, 2020
72213f2
fix $.isEmpty performance (#1096)
tasuku-s Apr 25, 2020
7f876e8
Add issue templates (#1114)
gohabereg Apr 25, 2020
66e70fa
Update issue templates (#1121)
neSpecc Apr 25, 2020
5218a6a
Allowing deleting block by block id (#1108)
athul7744 Apr 25, 2020
ae8591c
Allow navigate next from last non-initial block (#1110)
gohabereg Apr 25, 2020
f6b7b2e
Create CODE_OF_CONDUCT.md (#1171)
talyguryn May 27, 2020
e3410be
Update dependencies (#1122)
gohabereg May 27, 2020
b0ddb10
Feature/disable tab event config (#1164)
flaming-cl May 27, 2020
1eb6d81
Highlight first block on autofocus (#1127)
gohabereg May 27, 2020
5fe8b08
Fix shortcut for external tools (#1141)
sonnn May 27, 2020
7c3bf76
Hotfix/issue1133 selection shortcut removed on editor destroy (#1140)
sis-dk May 27, 2020
ffe5bbc
[Feature] BlockAPI Interface (#1075)
gohabereg May 27, 2020
ff6bd2d
Fix BlockManager.insert method (#1172)
gohabereg Jun 2, 2020
e1500f7
Update tools master branches (#1180)
talyguryn Jun 2, 2020
26b19a3
Fix behaviour of inputs editing in block settings (#1123)
gohabereg Jun 2, 2020
8341c33
Merge branch 'master' into release/2.18
neSpecc Jun 2, 2020
239aaf6
lint code
neSpecc Jun 3, 2020
4cea66f
Update CHANGELOG.md
neSpecc Jun 3, 2020
3219030
Return the result of block.call
jacobsmith Jun 17, 2020
6749013
Merge branch 'next' of github.com:codex-team/editor.js into pr/1205
gohabereg Jul 26, 2020
4382a60
Disable ESLint for call method return value
jacobsmith Aug 6, 2020
03fde39
Change any type to unknown and add to CHANGELOG.md
ranemihir Aug 14, 2020
8e29efb
Add unknown to eslint globals
ranemihir Aug 14, 2020
ac4eab7
upd
neSpecc Aug 18, 2020
8d12488
Merge branch 'next' into pr/1205
neSpecc Aug 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow navigate next from last non-initial block (#1110)
Resolves #1103
  • Loading branch information
gohabereg committed Apr 25, 2020
commit ae8591c8a6ae149444f52e8573d7590ae5e52843
2 changes: 1 addition & 1 deletion dist/editor.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

### 2.18

- `New` *I18n API* — Ability to provide internalization for Editor.js core and tools. [#751](https://github.com/codex-team/editor.js/issues/751)
- `Improvements` - TSLint (deprecated) replaced with ESLint, old config changed to [CodeX ESLint Config](https://github.com/codex-team/eslint-config).
- `Improvements` - Fix many code-style issues, add missed annotations.
- `Improvements` - Adjusted GitHub action for ESLint.
- `Improvements` - Blocks API: if `blocks.delete` method is called, but no Block is selected, show warning instead of throwing an error [#1102](https://github.com/codex-team/editor.js/issues/1102)
- `Improvements` - Blocks API: allow deletion of blocks by specifying block index via `blocks.delete(index)`.
- `Improvements` - UX: Navigate next Block from the last non-initial one creates new initial Block now [1103](https://github.com/codex-team/editor.js/issues/1103)
- `Improvements` - Improve performance of DOM traversing at the `isEmpty()` method [#1095](https://github.com/codex-team/editor.js/issues/1095)
- `Fix` - Editor's styles won't be appended to the `<head>` when another instance have already do that [#1079](https://github.com/codex-team/editor.js/issues/1079)
- `New` *I18n API* — Ability to provide internalization for Editor.js core and tools. [#751](https://github.com/codex-team/editor.js/issues/751)
- `Fix` - Fixed wrong toolbar icon centering in Firefox [#1120](https://github.com/codex-team/editor.js/pull/1120)
- `Improvements` - Improve performance of DOM traversing at the `isEmpty()` method [#1095](https://github.com/codex-team/editor.js/issues/1095)
- `Fix` - Toolbox: Tool's order in Toolbox now saved in accordance with `tools` object keys order [#1073](https://github.com/codex-team/editor.js/issues/1073)

### 2.17
Expand Down
22 changes: 18 additions & 4 deletions src/components/modules/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,31 @@ export default class Caret extends Module {
* @returns {boolean}
*/
public navigateNext(force = false): boolean {
const { currentBlock, nextContentfulBlock } = this.Editor.BlockManager;
const { BlockManager, Tools } = this.Editor;
const { currentBlock, nextContentfulBlock } = BlockManager;
const { nextInput } = currentBlock;

if (!nextContentfulBlock && !nextInput) {
return false;
let nextBlock = nextContentfulBlock;

if (!nextBlock && !nextInput) {
/**
* If there is no nextBlock and currentBlock is initial, do not navigate
*/
if (Tools.isInitial(currentBlock.tool)) {
return false;
}

/**
* If there is no nextBlock, but currentBlock is not initial,
* insert new initial block at the end and navigate to it
*/
nextBlock = BlockManager.insertAtEnd();
}

if (force || this.isAtEnd) {
/** If next Tool`s input exists, focus on it. Otherwise set caret to the next Block */
if (!nextInput) {
this.setToBlock(nextContentfulBlock, this.positions.START);
this.setToBlock(nextBlock, this.positions.START);
} else {
this.setToInput(nextInput, this.positions.START);
}
Expand Down