Bug 964204 - fix drag glitches in Australis panel and palette, r=mikedeboer

--HG--
extra : rebase_source : ca944ff625641f4c69141d7740d40d243b9971b4
This commit is contained in:
Gijs Kruitbosch 2014-01-27 18:44:34 +00:00
parent 82d21bdfd6
commit 7a68e77608
3 changed files with 9 additions and 4 deletions

View File

@ -1411,10 +1411,13 @@ CustomizeMode.prototype = {
_setGridDragActive: function(aDragOverNode, aDraggedItem, aValue) {
let targetArea = this._getCustomizableParent(aDragOverNode);
let draggedWrapper = this.document.getElementById("wrapper-" + aDraggedItem.id);
let originArea = this._getCustomizableParent(draggedWrapper);
let positionManager = DragPositionManager.getManagerForArea(targetArea);
let draggedSize = this._getDragItemSize(aDragOverNode, aDraggedItem);
let isWide = aDraggedItem.classList.contains(CustomizableUI.WIDE_PANEL_CLASS);
positionManager.insertPlaceholder(targetArea, aDragOverNode, isWide, draggedSize);
positionManager.insertPlaceholder(targetArea, aDragOverNode, isWide, draggedSize,
originArea == targetArea);
},
_getDragItemSize: function(aDragOverNode, aDraggedItem) {

View File

@ -126,7 +126,7 @@ AreaPositionManager.prototype = {
* they would have if we had inserted something before aBefore. We use CSS
* transforms for this, which are CSS transitioned.
*/
insertPlaceholder: function(aContainer, aBefore, aWide, aSize) {
insertPlaceholder: function(aContainer, aBefore, aWide, aSize, aIsFromThisArea) {
let isShifted = false;
let shiftDown = aWide;
for (let child of aContainer.children) {
@ -157,7 +157,7 @@ AreaPositionManager.prototype = {
if (this.__moveDown) {
shiftDown = true;
}
if (!this._lastPlaceholderInsertion) {
if (aIsFromThisArea && !this._lastPlaceholderInsertion) {
child.setAttribute("notransition", "true");
}
// Determine the CSS transform based on the next node:
@ -167,7 +167,8 @@ AreaPositionManager.prototype = {
child.style.transform = "";
}
}
if (aContainer.lastChild && !this._lastPlaceholderInsertion) {
if (aContainer.lastChild && aIsFromThisArea &&
!this._lastPlaceholderInsertion) {
// Flush layout:
aContainer.lastChild.getBoundingClientRect();
// then remove all the [notransition]

View File

@ -75,6 +75,7 @@ toolbarpaletteitem[place="panel"] {
transition: transform .3s ease-in-out;
}
toolbarpaletteitem[notransition].panel-customization-placeholder,
toolbarpaletteitem[notransition][place="palette"],
toolbarpaletteitem[notransition][place="panel"] {
transition: none;