Skip to content

Commit

Permalink
Added field for editing class on wrapper item.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin L. Dodson committed Mar 9, 2018
1 parent c4d42dc commit 55972e0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
15 changes: 11 additions & 4 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20416,11 +20416,17 @@
_this.render = function () {
return _react2.default.createElement(
'div',
{ key: _this.props.text },
{
key: _this.props.text,
className: _this.props.className
},
_this.props.text,
_react2.default.createElement(
'div',
{ onClick: _this.remove, className: _this.props.className || "remove" },
{
onClick: _this.remove,
className: _this.props.className + '-remove'
},
' \xD7 '
)
);
Expand Down Expand Up @@ -20547,7 +20553,7 @@
};

_this2.makeTagElement = function (text) {
return _react2.default.createElement(RIETag, { key: text, text: text, removeHandler: _this2.removeTag });
return _react2.default.createElement(RIETag, { className: _this2.props.wrapperEditing, key: text, text: text, removeHandler: _this2.removeTag });
};

_this2.renderEditingComponent = function () {
Expand Down Expand Up @@ -20581,7 +20587,8 @@
blurDelay: _propTypes2.default.number,
placeholder: _propTypes2.default.string,
wrapper: _propTypes2.default.string,
wrapperClass: _propTypes2.default.string
wrapperClass: _propTypes2.default.string,
wrapperEditing: _propTypes2.default.string
};
exports.default = RIETags;

Expand Down
14 changes: 12 additions & 2 deletions src/RIETags.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ class RIETag extends React.Component {
};

render = () => {
return <div key={this.props.text}>{this.props.text}<div onClick={this.remove} className={this.props.className || "remove"}> × </div></div>;
return <div
key={this.props.text}
className={this.props.className}
>
{this.props.text}
<div
onClick={this.remove}
className={`${this.props.className}-remove`}
> × </div>
</div>;
};
}

Expand All @@ -41,6 +50,7 @@ export default class RIETags extends RIEStatefulBase {
placeholder: PropTypes.string,
wrapper: PropTypes.string,
wrapperClass: PropTypes.string,
wrapperEditing: PropTypes.string,
};

addTag = (tag) => {
Expand Down Expand Up @@ -141,7 +151,7 @@ export default class RIETags extends RIEStatefulBase {
};

makeTagElement = (text) => {
return <RIETag key={text} text={text} removeHandler={this.removeTag} />;
return <RIETag className={this.props.wrapperEditing} key={text} text={text} removeHandler={this.removeTag} />;
};

renderEditingComponent = () => {
Expand Down

0 comments on commit 55972e0

Please sign in to comment.