Yuki Takei 8 лет назад
Родитель
Сommit
ad62d0c5b8

+ 1 - 2
resource/js/components/PageEditor/Editor.js

@@ -1,8 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 
-import emojione from 'emojione';
-import emojiStrategy from 'emojione/emoji_strategy.json';
 import * as codemirror from 'codemirror';
 
 import { UnControlled as ReactCodeMirror } from 'react-codemirror2';
@@ -87,6 +85,7 @@ export default class Editor extends React.Component {
       <ReactCodeMirror
         ref="cm"
         editorDidMount={(editor) => {
+          // add paste event handler
           editor.on('paste', pasteHelper.pasteHandler);
         }}
         value={this.state.value}

+ 1 - 3
resource/js/components/PageEditor/PasteHelper.js

@@ -33,9 +33,7 @@ class PasteHelper {
     if (text.length == 0) { return; }
 
     const curPos = editor.getCursor();
-    // calc BOL (beginning of line)
-    const bol = { line: curPos.line, ch: 0 };
-
+    const bol = { line: curPos.line, ch: 0 }; // beginning of line
 
     // get strings from BOL(beginning of line) to current position
     const strFromBol = editor.getDoc().getRange(bol, curPos);