mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Upgrade CodeMirror
closes #2108 - upgrade to 4.0.1 - requires removing the deprecated setLine method
This commit is contained in:
parent
80bdfd7967
commit
6d3cd84309
2 changed files with 10 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
"name": "ghost",
|
"name": "ghost",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"backbone": "1.0.0",
|
"backbone": "1.0.0",
|
||||||
"codemirror": "3.15.0",
|
"codemirror": "4.0.1",
|
||||||
"Countable": "2.0.2",
|
"Countable": "2.0.2",
|
||||||
"fastclick": "1.0.0",
|
"fastclick": "1.0.0",
|
||||||
"ghost-ui": "0.1.2",
|
"ghost-ui": "0.1.2",
|
||||||
|
|
|
@ -45,8 +45,15 @@
|
||||||
// ln - line number
|
// ln - line number
|
||||||
addMarker = function (line, ln) {
|
addMarker = function (line, ln) {
|
||||||
var marker,
|
var marker,
|
||||||
magicId = '{<' + uploadId + '>}';
|
magicId = '{<' + uploadId + '>}',
|
||||||
editor.setLine(ln, magicId + line.text);
|
newText = magicId + line.text;
|
||||||
|
|
||||||
|
editor.replaceRange(
|
||||||
|
newText,
|
||||||
|
{line: ln, ch: 0},
|
||||||
|
{line: ln, ch: newText.length}
|
||||||
|
);
|
||||||
|
|
||||||
marker = editor.markText(
|
marker = editor.markText(
|
||||||
{line: ln, ch: 0},
|
{line: ln, ch: 0},
|
||||||
{line: ln, ch: (magicId.length)},
|
{line: ln, ch: (magicId.length)},
|
||||||
|
|
Loading…
Add table
Reference in a new issue