Browse Source

Fix sorter in StyleManager

pull/2524/head
Artur Arseniev 7 years ago
parent
commit
4fdcc36bf9
  1. 2
      src/commands/view/SelectPosition.js
  2. 8
      src/utils/Sorter.js

2
src/commands/view/SelectPosition.js

@ -28,7 +28,7 @@ export default {
scale: () => this.em.getZoomDecimal() scale: () => this.em.getZoomDecimal()
}); });
trg && this.sorter.startSort(trg); trg && this.sorter.startSort(trg, { container });
}, },
/** /**

8
src/utils/Sorter.js

@ -79,7 +79,7 @@ export default Backbone.View.extend({
}, },
getContainerEl(elem) { getContainerEl(elem) {
if (elem) return elem.ownerDocument.body; if (elem) this.el = elem;
if (!this.el) { if (!this.el) {
var el = this.opt.container; var el = this.opt.container;
@ -300,11 +300,11 @@ export default Backbone.View.extend({
* Picking component to move * Picking component to move
* @param {HTMLElement} src * @param {HTMLElement} src
* */ * */
startSort(src) { startSort(src, opts = {}) {
const em = this.em; const em = this.em;
const itemSel = this.itemSel; const itemSel = this.itemSel;
const contSel = this.containerSel; const contSel = this.containerSel;
const container = this.getContainerEl(src); const container = this.getContainerEl(opts.container);
const docs = this.getDocuments(src); const docs = this.getDocuments(src);
const onStart = this.onStart; const onStart = this.onStart;
let srcModel; let srcModel;
@ -1013,7 +1013,7 @@ export default Backbone.View.extend({
const src = this.eV; const src = this.eV;
const moved = [null]; const moved = [null];
const docs = this.getDocuments(); const docs = this.getDocuments();
const container = this.getContainerEl(src); const container = this.getContainerEl();
const onEndMove = this.onEndMove; const onEndMove = this.onEndMove;
const { target, lastPos } = this; const { target, lastPos } = this;
off(container, 'mousemove dragover', this.onMove); off(container, 'mousemove dragover', this.onMove);

Loading…
Cancel
Save