Skip to content

Commit

Permalink
When drag/dropping something in the middle, place it after the curren…
Browse files Browse the repository at this point in the history
…t tab
  • Loading branch information
sedwards2009 committed Jun 15, 2017
1 parent a774369 commit afaa1a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/MainWebUi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ export class MainWebUi extends ThemeableElementBase implements keybindingmanager
const target = ev.target;
if (target instanceof TabWidget) {
if (detail.mimeType === ElementMimeType.MIMETYPE) {
this._handleElementDroppedEvent(target, target.getSelectedIndex(), detail.dropData);
this._handleElementDroppedEvent(target, target.getSelectedIndex() + 1, detail.dropData);
} else if (detail.mimeType === FrameMimeType.MIMETYPE) {
this._handleFrameDroppedEvent(target, target.getSelectedIndex(), detail.dropData);
this._handleFrameDroppedEvent(target, target.getSelectedIndex() + 1, detail.dropData);
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/SplitLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,7 @@ export class SplitLayout {
const {tabWidgetInfo: sourceTabWidgetInfo, tabInfo} = findTabWidgetInfoByTab(this._rootInfoNode, tabElement);
const targetTabWidgetInfo = findTabWidgetInfoByTabWidget(this._rootInfoNode, targetTabWidget);

if (tabIndex > targetTabWidgetInfo.children.length) {
return;
}
tabIndex = Math.min(tabIndex, targetTabWidgetInfo.children.length);

if (sourceTabWidgetInfo === targetTabWidgetInfo) {
const frontList = sourceTabWidgetInfo.children.slice(0, tabIndex).filter(kid => kid !== tabInfo);
Expand Down

0 comments on commit afaa1a5

Please sign in to comment.