From cd858d12f3adcb7067ae922a6d205abde3fe0807 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 5 Mar 2013 18:48:49 +0900 Subject: [PATCH] Find pseudo drop target tab from the drop position for dragging on the top or bottom of the tab bar (#461) --- modules/tabbarDNDObserver.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index 2c00fb05..ec74c789 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -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'); } }