Find pseudo drop target tab from the drop position for dragging on the top or bottom of the tab bar (#461)

This commit is contained in:
YUKI Hiroshi 2013-03-05 18:48:49 +09:00
parent bcad184e5d
commit cd858d12f3

View File

@ -321,6 +321,17 @@ catch(e) {
b.tabContainer._getDropIndex(aEvent) ;
if (DEBUG) dump(' on the tab '+index+'\n');
info.target = tab = tabs[Math.min(index, lastTabIndex)];
if (index == tab._tPos) {
if (index > 0)
info.target = tab = tabs[index - 1];
info.position = sv.kDROP_AFTER;
if (DEBUG) dump(' => after the last tab\n');
} else if (index == firstTab._tPos) {
if (index < tabs.length-1)
info.target = tab = tabs[index + 1];
info.position = sv.kDROP_BEFORE;
if (DEBUG) dump(' => before the first tab\n');
}
if (DEBUG) dump(' info.target = '+info.target._tPos+'\n');
}
}