Skip to content

Commit

Permalink
Fix cloning of attribute in clone method
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Dec 20, 2017
1 parent 8539f28 commit 0dbb420
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions dist/grapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4627,7 +4627,8 @@ module.exports = Backbone.Model.extend(_Styleable2.default).extend({
clone: function clone(reset) {
var em = this.em;
var style = this.getStyle();
var attr = (0, _underscore.clone)(this.attributes);
var attr = _extends({}, this.attributes);
attr.attributes = _extends({}, attr.attributes);
delete attr.attributes.id;
attr.components = [];
attr.classes = [];
Expand Down Expand Up @@ -23211,7 +23212,7 @@ module.exports = function () {
plugins: plugins,

// Will be replaced on build
version: '0.12.55',
version: '0.12.56',

/**
* Initializes an editor based on passed options
Expand Down Expand Up @@ -35878,7 +35879,7 @@ module.exports = function () {
if (customRte) {
customRte.disable(el, rte);
} else {
rte.disable();
rte && rte.disable();
}

hideToolbar();
Expand Down
6 changes: 3 additions & 3 deletions dist/grapes.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grapesjs",
"description": "Free and Open Source Web Builder Framework",
"version": "0.12.55",
"version": "0.12.56",
"author": "Artur Arseniev",
"license": "BSD-3-Clause",
"homepage": "http://grapesjs.com",
Expand Down
3 changes: 2 additions & 1 deletion src/dom_components/model/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ module.exports = Backbone.Model.extend(Styleable).extend({
clone(reset) {
const em = this.em;
const style = this.getStyle();
const attr = clone(this.attributes);
const attr = { ...this.attributes };
attr.attributes = { ...attr.attributes };
delete attr.attributes.id;
attr.components = [];
attr.classes = [];
Expand Down

0 comments on commit 0dbb420

Please sign in to comment.