diff --git a/src/browser/js/app/editor/index.js b/src/browser/js/app/editor/index.js index ea77dfa7..006c4d68 100644 --- a/src/browser/js/app/editor/index.js +++ b/src/browser/js/app/editor/index.js @@ -544,10 +544,11 @@ var Editor = class Editor { } if (w.props.width !== undefined || w.props.height !== undefined) newWidgets.push(updateWidget(w, {preventSelect: this.selectedWidgets.length > 1})) - this.pushHistory() } + this.pushHistory() + if (newWidgets.length > 1) this.select(newWidgets, {preventSelect: this.selectedWidgets.length > 1}) } @@ -572,10 +573,11 @@ var Editor = class Editor { } newWidgets.push(updateWidget(w, {preventSelect: this.selectedWidgets.length > 1})) - this.pushHistory() } + this.pushHistory() + if (newWidgets.length > 1) this.select(newWidgets) } @@ -625,6 +627,23 @@ var Editor = class Editor { if (!path || path.length > d1[i].path.length) path = d1[i].path } + if (d1.length > 1) { + // path intersection + var stop, j, k, n + for (j = 0; j < path.length; j++) { + for (k = 0; k < d1.length; k++) { + if (d1[k].path[j] !== path[j]) { + stop = true + break + } + } + if (stop) break + } + n = stop ? j : j - 1 + path.splice(n, path.length - n) + } + + this.updateWidgetByPath(path) } @@ -643,6 +662,22 @@ var Editor = class Editor { if (!path || path.length > d1[i].path.length) path = d1[i].path } + if (d1.length > 1) { + // path intersection + var stop, j, k, n + for (j = 0; j < path.length; j++) { + for (k = 0; k < d1.length; k++) { + if (d1[k].path[j] !== path[j]) { + stop = true + break + } + } + if (stop) break + } + n = stop ? j : j - 1 + path.splice(n, path.length - n) + } + this.updateWidgetByPath(path) this.historyState -= 1