Skip to content

Commit

Permalink
Disable forward button animation when switching tab on FF10+
Browse files Browse the repository at this point in the history
  • Loading branch information
ephemeralViolette committed Feb 24, 2024
1 parent 974f116 commit 65f5d7e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Echelon/Profile Folder/chrome/Echelon.tweaks.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@
transition: none !important;
}

/*
* Disable forward button style changes while the tab is changing.
*/
#main-window[echelon-style-2][echelon-tabchanging] #forward-button,
#main-window[echelon-style-2][echelon-tabchanging] #identity-icon-box,
#main-window[echelon-style-3][echelon-tabchanging] #forward-button,
#main-window[echelon-style-3][echelon-tabchanging] #identity-icon-box {
transition: none !important;
}

#main-window[echelon-style-3] #urlbar-background,
#main-window[echelon-style-3] #searchbar,
#main-window[echelon-style-3] #stop-reload-button.unified {
Expand Down
12 changes: 12 additions & 0 deletions Echelon/Profile Folder/chrome/JS/echelon_layout.uc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ let g_echelonLayoutManager;
toolboxRoot.addEventListener("aftercustomization", this);
this.refreshToolboxLayout();
this.hookTabArrowScrollbox();

let tabsBox = await waitForElement("#tabbrowser-tabs");
tabsBox.addEventListener("TabSelect", this.onTabSwitch.bind(this));
}

initTabsOnTop()
Expand Down Expand Up @@ -175,6 +178,15 @@ let g_echelonLayoutManager;
}
}

onTabSwitch()
{
// This attribute is added in order to check in CSS if the tab is
// currently being switched. This is done in order to disable or
// enable certain animations.
document.documentElement.setAttribute("echelon-tabchanging", "true");
setTimeout(() => document.documentElement.removeAttribute("echelon-tabchanging"), 50);
}

/**
* We need this hack for Australis automatic tab scrolling (opening new tab, ctrl+num)
* to work correctly. Otherwise, it will be offset a few pixels into the tab.
Expand Down
2 changes: 1 addition & 1 deletion Echelon/Profile Folder/chrome/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
305
306
11 changes: 11 additions & 0 deletions Echelon/Profile Folder/chrome/echelon-scss-src/Echelon.tweaks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,17 @@
transition: none !important;
}

/*
* Disable forward button style changes while the tab is changing.
*/
#main-window[echelon-style-2][echelon-tabchanging],
#main-window[echelon-style-3][echelon-tabchanging] {
#forward-button,
#identity-icon-box {
transition: none !important;
}
}

#main-window[echelon-style-3] #urlbar-background,
#main-window[echelon-style-3] #searchbar,
#main-window[echelon-style-3] #stop-reload-button.unified {
Expand Down

0 comments on commit 65f5d7e

Please sign in to comment.