зеркало из https://github.com/mozilla/pjs.git
Bug 251627 - Icon incorrectly placed when dropping an icon from the Customize Toolbar windows to the Toolbars when interface is RTL, Thunderbird part. r=mscott
This commit is contained in:
Родитель
4a24f4cbe6
Коммит
b1c4d0170a
|
@ -550,10 +550,11 @@ function setWrapperType(aItem, aWrapper)
|
|||
function setDragActive(aItem, aValue)
|
||||
{
|
||||
var node = aItem;
|
||||
var value = "left";
|
||||
var direction = window.getComputedStyle(aItem, null).direction;
|
||||
var value = direction == "ltr"? "left" : "right";
|
||||
if (aItem.localName == "toolbar") {
|
||||
node = aItem.lastChild;
|
||||
value = "right";
|
||||
value = direction == "ltr"? "right" : "left";
|
||||
}
|
||||
|
||||
if (!node)
|
||||
|
@ -750,11 +751,16 @@ var toolbarDNDObserver =
|
|||
if (dropTarget.localName == "toolbar") {
|
||||
gCurrentDragOverItem = dropTarget;
|
||||
} else {
|
||||
var dropTargetWidth = dropTarget.boxObject.width;
|
||||
var dropTargetX = dropTarget.boxObject.x;
|
||||
|
||||
gCurrentDragOverItem = null;
|
||||
if (aEvent.clientX > (dropTargetX + (dropTargetWidth / 2))) {
|
||||
|
||||
var direction = window.getComputedStyle(dropTarget.parentNode, null).direction;
|
||||
var dropTargetCenter = dropTarget.boxObject.x + (dropTarget.boxObject.width / 2);
|
||||
if (direction == "ltr")
|
||||
dragAfter = aEvent.clientX > dropTargetCenter;
|
||||
else
|
||||
dragAfter = aEvent.clientX < dropTargetCenter;
|
||||
|
||||
if (dragAfter) {
|
||||
gCurrentDragOverItem = dropTarget.nextSibling;
|
||||
if (!gCurrentDragOverItem)
|
||||
gCurrentDragOverItem = toolbar;
|
||||
|
|
Загрузка…
Ссылка в новой задаче