cm-page-builder
Advanced tools
Comparing version 1.2.15 to 1.2.17
@@ -110,3 +110,5 @@ 'use strict'; | ||
onFocus: this.handleFocus, | ||
onBlur: this.emitUpdate, | ||
onBlur: function onBlur(e) { | ||
return _this2.emitChange(e, context); | ||
}, | ||
contentEditable: context.status === 'Edit', | ||
@@ -116,4 +118,4 @@ placeholder: content || context.status === 'Edit' ? placeholder : '', | ||
styles: styles, | ||
'data-gramm_editor': 'false' | ||
// onSelect={context.handleSelection} | ||
'data-gramm_editor': 'false', | ||
onSelect: context.handleSelection | ||
}) | ||
@@ -120,0 +122,0 @@ ); |
@@ -129,13 +129,15 @@ 'use strict'; | ||
_this.handleSelection = function (e) { | ||
var selection = window.getSelection(); | ||
if (selection && selection.rangeCount > 0) { | ||
var dimensions = selection.getRangeAt(0).getBoundingClientRect(); | ||
_this.currentElemSelection = { elemId: e.target.dataset.id, selection: selection }; | ||
if (dimensions.width > 1) { | ||
var scrollOffsets = _this.getScrollOffsets(); | ||
var actionDomRect = { top: dimensions.top + scrollOffsets.y - dimensions.height - 10, left: dimensions.left + scrollOffsets.x }; | ||
_this.setState({ actionDomRect: actionDomRect }); | ||
if (e.target.getAttribute('placeholder') !== 'Title of the page') { | ||
var selection = window.getSelection(); | ||
if (selection && selection.rangeCount > 0) { | ||
var dimensions = selection.getRangeAt(0).getBoundingClientRect(); | ||
_this.currentElemSelection = { elemId: e.target.dataset.id, selection: selection }; | ||
if (dimensions.width > 1) { | ||
var scrollOffsets = _this.getScrollOffsets(); | ||
var actionDomRect = { top: dimensions.top + scrollOffsets.y - dimensions.height - 10, left: dimensions.left + scrollOffsets.x }; | ||
_this.setState({ actionDomRect: actionDomRect }); | ||
} | ||
} else { | ||
_this.currentElemSelection = null; | ||
} | ||
} else { | ||
_this.currentElemSelection = null; | ||
} | ||
@@ -295,4 +297,2 @@ _this.handleRangeSelection(e); | ||
var isEdit = this.props.status === 'Edit'; | ||
console.log('current', currentType); | ||
return _react2.default.createElement( | ||
@@ -299,0 +299,0 @@ 'div', |
{ | ||
"name": "cm-page-builder", | ||
"version": "1.2.15", | ||
"version": "1.2.17", | ||
"description": "Awesome react starter kit", | ||
@@ -5,0 +5,0 @@ "main": "lib/page/index.js", |
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
127769
3041