fix tab dragging issue

This commit is contained in:
zadam 2019-05-22 21:59:14 +02:00
parent dedc1e708f
commit 027b3eaed8
2 changed files with 7 additions and 2 deletions

View File

@ -73,6 +73,10 @@ async function importIntoNote(importNoteId) {
} }
async function uploadFiles(importNoteId, files, options) { async function uploadFiles(importNoteId, files, options) {
if (files.length === 0) {
return;
}
let noteId; let noteId;
for (const file of files) { for (const file of files) {

View File

@ -34,7 +34,6 @@ class TabRow {
constructor(el) { constructor(el) {
this.draggabillies = []; this.draggabillies = [];
this.eventListeners = {}; this.eventListeners = {};
this.tabIdCounter = 1;
this.el = el; this.el = el;
this.hideTabRowForOneTab = false; this.hideTabRowForOneTab = false;
@ -365,7 +364,9 @@ class TabRow {
if (destinationIndex < originIndex) { if (destinationIndex < originIndex) {
tabEl.parentNode.insertBefore(tabEl, this.tabEls[destinationIndex]); tabEl.parentNode.insertBefore(tabEl, this.tabEls[destinationIndex]);
} else { } else {
tabEl.parentNode.insertBefore(tabEl, this.tabEls[destinationIndex + 1]); const beforeEl = this.tabEls[destinationIndex + 1] || this.newTabEl;
tabEl.parentNode.insertBefore(tabEl, beforeEl);
} }
await this.emit('tabReorder', { tabEl, originIndex, destinationIndex }); await this.emit('tabReorder', { tabEl, originIndex, destinationIndex });
this.layoutTabs(); this.layoutTabs();