Skip to content

Commit ef23cea

Browse files
committed
TASK: fix compatibility with CKE11
This is just a rebase of #3
1 parent 5e40be9 commit ef23cea

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

Resources/Private/Footnotes/src/footnotePlugin.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function _findBound(position, value, lookBack) {
1717
node = lookBack ? node.previousSibling : node.nextSibling;
1818
}
1919

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

@@ -66,7 +65,7 @@ class FootnoteCommand extends Command {
6665
attributes.set(this.attributeKey, value);
6766
const node = writer.createText(value, attributes);
6867
writer.insert(node, position);
69-
writer.setSelection(Range.createOn(node));
68+
writer.setSelection(Range._createOn(node));
7069
}
7170
} else {
7271
const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);
@@ -96,17 +95,17 @@ export default class Footnote extends Plugin {
9695
});
9796

9897
editor.conversion.for('upcast').elementToAttribute({
99-
view: {
100-
name: 'span',
101-
attributes: {
102-
'data-footnote': true
103-
}
104-
},
105-
model: {
106-
key: FOOTNOTE,
107-
value: viewElement => viewElement.getAttribute('data-footnote')
98+
view: {
99+
name: 'span',
100+
attributes: {
101+
'data-footnote': true
108102
}
109-
});
103+
},
104+
model: {
105+
key: FOOTNOTE,
106+
value: viewElement => viewElement.getAttribute('data-footnote')
107+
}
108+
});
110109
editor.commands.add(FOOTNOTE, new FootnoteCommand(this.editor, FOOTNOTE));
111110
}
112111
}

Resources/Public/JavaScript/Footnote/Plugin.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/Public/JavaScript/Footnote/Plugin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)