Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column chooser #9

Merged
merged 13 commits into from
Jan 22, 2018
Prev Previous commit
Next Next commit
Fixed performance bug which caused a dragged node to be inserted befo…
…re itself.
  • Loading branch information
texodus committed Jan 21, 2018
commit 2c73e09003a0fe2cc17c597b882162a78ff230ba
8 changes: 5 additions & 3 deletions packages/perspective-viewer/src/js/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ function column_dragover(event) {
this._drop_target_hover.setAttribute('drop-target', true);
}
let index = calc_index.call(this, event);
if (this._active_columns.children[index]) {
if (!this._active_columns.children[index].hasAttribute('drop-target')) {
if (index < this._active_columns.children.length) {
if (!this._active_columns.children[Math.max(index - 1, 0)].hasAttribute('drop-target') && !this._active_columns.children[index].hasAttribute('drop-target')) {
this._active_columns.insertBefore(this._drop_target_hover, this._active_columns.children[index]);
}
} else {
this._active_columns.appendChild(this._drop_target_hover);
if (!this._active_columns.children[this._active_columns.children.length - 1].hasAttribute('drop-target')) {
this._active_columns.appendChild(this._drop_target_hover);
}
}
}

Expand Down