mirror of
https://github.com/zen-browser/desktop.git
synced 2026-07-10 19:09:30 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61e0790144 | ||
|
|
03f251ff4a |
@@ -1864,11 +1864,6 @@ class nsZenWorkspaces {
|
|||||||
}
|
}
|
||||||
const newTransform = diff * 100;
|
const newTransform = diff * 100;
|
||||||
element.style.transform = `translateX(${newTransform + offsetPixels / 2}%)`;
|
element.style.transform = `translateX(${newTransform + offsetPixels / 2}%)`;
|
||||||
// A special case for two spaces
|
|
||||||
if (spaceLen === 2 && diff !== 0) {
|
|
||||||
const side = offsetPixels > 0 ? -100 : 100;
|
|
||||||
element.style.transform = `translateX(${side + offsetPixels / 2}%)`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Hide other essentials with different containerTabId
|
// Hide other essentials with different containerTabId
|
||||||
for (const container of otherContainersEssentials) {
|
for (const container of otherContainersEssentials) {
|
||||||
@@ -2099,12 +2094,6 @@ class nsZenWorkspaces {
|
|||||||
offset += spaceLen;
|
offset += spaceLen;
|
||||||
}
|
}
|
||||||
offset = offset * 100;
|
offset = offset * 100;
|
||||||
// A special case for two spaces
|
|
||||||
if (spaceLen === 2 && offset !== 0) {
|
|
||||||
const currentTransform =
|
|
||||||
parseFloat(element.style.transform.split("(")[1]) || 0;
|
|
||||||
offset = currentTransform >= 0 ? 100 : -100;
|
|
||||||
}
|
|
||||||
const newTransform = `translateX(${offset}%)`;
|
const newTransform = `translateX(${offset}%)`;
|
||||||
// Only animate the workspace that is coming in, to avoid having multiple workspaces
|
// Only animate the workspace that is coming in, to avoid having multiple workspaces
|
||||||
// animating off-screen at the same time which can cause performance issues. With an off
|
// animating off-screen at the same time which can cause performance issues. With an off
|
||||||
@@ -2181,17 +2170,6 @@ class nsZenWorkspaces {
|
|||||||
existingOffset = currentTransform || (isGoingLeft ? -100 : 100);
|
existingOffset = currentTransform || (isGoingLeft ? -100 : 100);
|
||||||
newOffset = 0;
|
newOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spaceLen === 2) {
|
|
||||||
if (containsPrev && !containsNew) {
|
|
||||||
existingOffset = currentTransform;
|
|
||||||
newOffset = currentTransform >= 0 ? 100 : -100;
|
|
||||||
} else {
|
|
||||||
existingOffset = currentTransform >= 0 ? 100 : -100;
|
|
||||||
newOffset = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const newTransform = `translateX(${newOffset}%)`;
|
const newTransform = `translateX(${newOffset}%)`;
|
||||||
let existingTransform = `translateX(${existingOffset}%)`;
|
let existingTransform = `translateX(${existingOffset}%)`;
|
||||||
if (shouldAnimate) {
|
if (shouldAnimate) {
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ const RECORD_TYPE_BY_PREFIX = Object.freeze({
|
|||||||
* Workspaces engine collection.
|
* Workspaces engine collection.
|
||||||
*/
|
*/
|
||||||
export class ZenWorkspacesRecord extends CryptoWrapper {
|
export class ZenWorkspacesRecord extends CryptoWrapper {
|
||||||
_logName = "Sync.Record.ZenWorkspaces";
|
_logName = "Sync.Record.ZenSpaces";
|
||||||
}
|
}
|
||||||
|
|
||||||
ZenWorkspacesRecord.prototype.type = "workspaces";
|
ZenWorkspacesRecord.prototype.type = "spaces";
|
||||||
|
|
||||||
function parseRecordId(id) {
|
function parseRecordId(id) {
|
||||||
const sep = id.indexOf("~");
|
const sep = id.indexOf("~");
|
||||||
@@ -51,7 +51,7 @@ function parseRecordId(id) {
|
|||||||
function createRecordId(type, id) {
|
function createRecordId(type, id) {
|
||||||
const prefix = RECORD_ID_PREFIX_BY_TYPE[type];
|
const prefix = RECORD_ID_PREFIX_BY_TYPE[type];
|
||||||
if (!prefix) {
|
if (!prefix) {
|
||||||
throw new Error(`Unknown Workspaces Sync record type: ${type}`);
|
throw new Error(`Unknown Spaces Sync record type: ${type}`);
|
||||||
}
|
}
|
||||||
return `${prefix}~${id}`;
|
return `${prefix}~${id}`;
|
||||||
}
|
}
|
||||||
@@ -371,11 +371,11 @@ class ZenWorkspacesTracker extends Tracker {
|
|||||||
*/
|
*/
|
||||||
export class ZenWorkspacesEngine extends SyncEngine {
|
export class ZenWorkspacesEngine extends SyncEngine {
|
||||||
static get name() {
|
static get name() {
|
||||||
return "Workspaces";
|
return "Spaces";
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(service) {
|
constructor(service) {
|
||||||
super("Workspaces", service);
|
super("Spaces", service);
|
||||||
}
|
}
|
||||||
|
|
||||||
get _storeObj() {
|
get _storeObj() {
|
||||||
|
|||||||
Reference in New Issue
Block a user