mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-11 17:57:32 +09:00
Issue #517 Part 1: Import newtab page from Basilisk (sans directory service provider module)
This commit is contained in:
parent
a179019413
commit
48cdeab201
20 changed files with 4821 additions and 314 deletions
|
|
@ -156,7 +156,7 @@ var gTransformation = {
|
|||
finish();
|
||||
} else {
|
||||
this.setSitePosition(aSite, targetPosition);
|
||||
this._whenTransitionEnded(aSite.node, finish);
|
||||
this._whenTransitionEnded(aSite.node, ["left", "top"], finish);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -181,13 +181,13 @@ var gTransformation = {
|
|||
|
||||
batch.push(new Promise(resolve => {
|
||||
if (!cells[aIndex]) {
|
||||
// The site disappeared from the grid, hide it.
|
||||
// The site disappeared from the grid, hide it.
|
||||
this.hideSite(aSite, resolve);
|
||||
} else if (this._getNodeOpacity(aSite.node) != 1) {
|
||||
// The site disappeared before but is now back, show it.
|
||||
// The site disappeared before but is now back, show it.
|
||||
this.showSite(aSite, resolve);
|
||||
} else {
|
||||
// The site's position has changed, move it around.
|
||||
// The site's position has changed, move it around.
|
||||
this._moveSite(aSite, aIndex, {unfreeze: unfreeze, callback: resolve});
|
||||
}
|
||||
}));
|
||||
|
|
@ -202,15 +202,19 @@ var gTransformation = {
|
|||
* Listens for the 'transitionend' event on a given node and calls the given
|
||||
* callback.
|
||||
* @param aNode The node that is transitioned.
|
||||
* @param aProperties The properties we'll wait to be transitioned.
|
||||
* @param aCallback The callback to call when finished.
|
||||
*/
|
||||
_whenTransitionEnded:
|
||||
function Transformation_whenTransitionEnded(aNode, aCallback) {
|
||||
function Transformation_whenTransitionEnded(aNode, aProperties, aCallback) {
|
||||
|
||||
aNode.addEventListener("transitionend", function onEnd() {
|
||||
aNode.removeEventListener("transitionend", onEnd, false);
|
||||
aCallback();
|
||||
}, false);
|
||||
let props = new Set(aProperties);
|
||||
aNode.addEventListener("transitionend", function onEnd(e) {
|
||||
if (props.has(e.propertyName)) {
|
||||
aNode.removeEventListener("transitionend", onEnd);
|
||||
aCallback();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -236,8 +240,9 @@ var gTransformation = {
|
|||
if (aCallback)
|
||||
aCallback();
|
||||
} else {
|
||||
if (aCallback)
|
||||
this._whenTransitionEnded(aNode, aCallback);
|
||||
if (aCallback) {
|
||||
this._whenTransitionEnded(aNode, ["opacity"], aCallback);
|
||||
}
|
||||
|
||||
aNode.style.opacity = aOpacity;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue