all files / packages/image/ InsertImageCommand.js

0% Statements 0/4
100% Branches 0/0
0% Functions 0/1
0% Lines 0/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                           
import { InsertNodeCommand } from '../../ui'
import insertImage from './insertImage'
 
class ImageCommand extends InsertNodeCommand {
 
  /*
    Inserts file and image nodes
  */
  execute(params) {
    let editorSession = params.editorSession
 
    editorSession.transaction((tx) => {
      params.files.forEach((file) => {
        insertImage(tx, file)
      })
    })
  }
 
}
 
export default ImageCommand