Skip to content

Commit

Permalink
TASK: fix compatibility with CKE11
Browse files Browse the repository at this point in the history
This is just a rebase of #3
  • Loading branch information
dimaip committed Nov 26, 2019
1 parent 5e40be9 commit ef23cea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
23 changes: 11 additions & 12 deletions Resources/Private/Footnotes/src/footnotePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function _findBound(position, value, lookBack) {
node = lookBack ? node.previousSibling : node.nextSibling;
}

//old Position.createAt created an error, used a protected function, okay?
return lastNode ? Position._createAt(lastNode, lookBack ? 'before' : 'after') : position;
}

Expand Down Expand Up @@ -66,7 +65,7 @@ class FootnoteCommand extends Command {
attributes.set(this.attributeKey, value);
const node = writer.createText(value, attributes);
writer.insert(node, position);
writer.setSelection(Range.createOn(node));
writer.setSelection(Range._createOn(node));
}
} else {
const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);
Expand Down Expand Up @@ -96,17 +95,17 @@ export default class Footnote extends Plugin {
});

editor.conversion.for('upcast').elementToAttribute({
view: {
name: 'span',
attributes: {
'data-footnote': true
}
},
model: {
key: FOOTNOTE,
value: viewElement => viewElement.getAttribute('data-footnote')
view: {
name: 'span',
attributes: {
'data-footnote': true
}
});
},
model: {
key: FOOTNOTE,
value: viewElement => viewElement.getAttribute('data-footnote')
}
});
editor.commands.add(FOOTNOTE, new FootnoteCommand(this.editor, FOOTNOTE));
}
}
3 changes: 1 addition & 2 deletions Resources/Public/JavaScript/Footnote/Plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Footnote/Plugin.js.map

Large diffs are not rendered by default.

0 comments on commit ef23cea

Please sign in to comment.