111-draft-js-image-plugin
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -16,2 +16,10 @@ 'use strict'; | ||
var _addBlankLine = require('./modifiers/addBlankLine'); | ||
var _addBlankLine2 = _interopRequireDefault(_addBlankLine); | ||
var _setSelection = require('./modifiers/setSelection'); | ||
var _setSelection2 = _interopRequireDefault(_setSelection); | ||
var _Image = require('./Image'); | ||
@@ -60,2 +68,20 @@ | ||
}, | ||
handleReturn: function handleReturn(evt, editorState, _ref2) { | ||
var getEditorState = _ref2.getEditorState, | ||
setEditorState = _ref2.setEditorState; | ||
var contentState = getEditorState().getCurrentContent(); | ||
var selectionState = getEditorState().getSelection(); | ||
var anchorKey = selectionState.getAnchorKey(); | ||
var block = contentState.getBlockForKey(anchorKey); | ||
if (block.getType() === 'atomic') { | ||
(0, _addBlankLine2.default)(getEditorState, setEditorState); | ||
(0, _setSelection2.default)(getEditorState, setEditorState, 'down', evt); | ||
return 'handled'; | ||
} | ||
return 'not-handled'; | ||
}, | ||
addImage: _addImage2.default | ||
@@ -62,0 +88,0 @@ }; |
{ | ||
"name": "111-draft-js-image-plugin", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Image Plugin for DraftJS", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12901
13
214