Skip to content

Instantly share code, notes, and snippets.

@thomasJang
Created January 7, 2019 13:05
Show Gist options
  • Select an option

  • Save thomasJang/63004154fb66fd41b51c4151a0ae3c82 to your computer and use it in GitHub Desktop.

Select an option

Save thomasJang/63004154fb66fd41b51c4151a0ae3c82 to your computer and use it in GitHub Desktop.
handleDragEnd.js
handleDragEnd = (tabIndex: number, e: React.DragEvent) => {
const { sortPanel } = this.props.appStore.uiStore.queryPanelStore;
if (
this.dragTabIndex !== undefined &&
this.dragOverTabIndex !== undefined &&
this.dragTabIndex !== this.dragOverTabIndex
) {
sortPanel(this.dragTabIndex, this.dragOverTabIndex);
}
this.dragTabIndex = undefined;
this.dragOverTabIndex = undefined;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment