Enlarge the droppable area for each tab.

Now, a half height of each tab becomes droppable area for the tab ifself. Fig:

+--------------------------+
|(drop area for "before")  |
+--------------------------+
|+-+(drop area for the tab |
|+-+ itself)               |
+--------------------------+
|(drop area for "after")   |
+--------------------------+
This commit is contained in:
YUKI Hiroshi 2016-07-05 13:52:04 +09:00
parent df4c1cfdad
commit 4583c22c26

View File

@ -365,7 +365,13 @@ catch(e) {
var sizeProp = sv.isVertical && pinned ? sv.invertedSizeProp : sv.sizeProp ;
var orient = pinned ? 'horizontal' : null ;
var boxPos = sv.getTabActualScreenPosition(tab, orient);
var beforeOrAfterDropAreaSize = Math.round(tab.boxObject[sizeProp] / dropAreasCount);
var beforeOrAfterDropAreaSize;
if (dropAreasCount == 2) {
beforeOrAfterDropAreaSize = Math.round(tab.boxObject[sizeProp] / dropAreasCount);
}
else { // enlarge the area to dop something on the tab itself
beforeOrAfterDropAreaSize = Math.round(tab.boxObject[sizeProp] / 4);
}
var eventPosition = aEvent[screenPositionProp];
// if (this.window['piro.sakura.ne.jp'].tabsDragUtils
// .canAnimateDraggedTabs(aEvent)) {
@ -374,7 +380,7 @@ catch(e) {
if (eventPosition < boxPos + beforeOrAfterDropAreaSize) {
info.position = isInverted ? sv.kDROP_AFTER : sv.kDROP_BEFORE ;
}
else if (dropAreasCount == 2 || eventPosition > boxPos + beforeOrAfterDropAreaSize + beforeOrAfterDropAreaSize) {
else if (dropAreasCount == 2 || eventPosition > boxPos + tab.boxObject[sizeProp] - beforeOrAfterDropAreaSize) {
info.position = isInverted ? sv.kDROP_BEFORE : sv.kDROP_AFTER ;
}
else {