gutenblock-controls
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -27,14 +27,2 @@ 'use strict'; | ||
joinValues: attributes ? true : false, | ||
clearRenderer: function clearRenderer() { | ||
return wp.element.createElement( | ||
'div', | ||
{ | ||
onClick: function onClick(e) { | ||
e.stopPropagation(); | ||
onDelete(); | ||
} | ||
}, | ||
'X' | ||
); | ||
}, | ||
onChange: function onChange(value) { | ||
@@ -41,0 +29,0 @@ return value ? _onChange(name, value.value) : null; |
@@ -107,25 +107,36 @@ 'use strict'; | ||
return _react2.default.Children.map(children, function (child) { | ||
return wp.element.createElement( | ||
return wp.element.createElement( | ||
'div', | ||
null, | ||
_react2.default.Children.map(children, function (child) { | ||
return wp.element.createElement( | ||
'div', | ||
{ | ||
style: { | ||
marginLeft: '10px', | ||
marginTop: '15px', | ||
display: 'flex' | ||
} | ||
}, | ||
_react2.default.cloneElement(child, { | ||
key: index, | ||
index: index, | ||
setAttributes: setAttributes, | ||
attributes: attributes && attributes[attribute] && attributes[attribute][index] ? attributes[attribute][index] : {}, | ||
onChange: function onChange(name, value) { | ||
return _this2.update(name, value, index, _onChange); | ||
} | ||
}) | ||
); | ||
}), | ||
wp.element.createElement( | ||
'div', | ||
{ | ||
style: { | ||
marginLeft: '10px', | ||
marginTop: '15px' | ||
onClick: function onClick() { | ||
return _this2.delete(childAttributes, childAttribute, index, _onChange); | ||
} | ||
}, | ||
_react2.default.cloneElement(child, { | ||
key: index, | ||
index: index, | ||
setAttributes: setAttributes, | ||
attributes: attributes && attributes[attribute] && attributes[attribute][index] ? attributes[attribute][index] : {}, | ||
onChange: function onChange(name, value) { | ||
return _this2.update(name, value, index, _onChange); | ||
}, | ||
onDelete: function onDelete(childAttributes, childAttribute) { | ||
return _this2.delete(childAttributes, childAttribute, index, _onChange); | ||
} | ||
}) | ||
); | ||
}); | ||
'Delete item' | ||
) | ||
); | ||
} | ||
@@ -132,0 +143,0 @@ }, { |
{ | ||
"name": "gutenblock-controls", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Useful inspector controls for gutenberg", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
25696
630