Skip to content

Commit

Permalink
refactor: H.hide, saving some bytes.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
mnater committed Dec 27, 2024
1 parent 2d97cd7 commit dad24d3
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Hyphenopoly_Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,15 @@ window.Hyphenopoly = {};
*/
H.hide = (state, mode) => {
if (state) {
let vis = "{visibility:hidden!important}";
const vis = (mode === 2)
? "{color:transparent!important}"
: "{visibility:hidden!important}";
const myStyle = (mode === 0)
? "html" + vis
: (mode !== -1)
? o.keys(H.s.selectors).join(vis) + vis
: "";
stylesNode = d[shortcuts.ce]("style");
let myStyle = "";
if (mode === 0) {
myStyle = "html" + vis;
} else if (mode !== -1) {
if (mode === 2) {
vis = "{color:transparent!important}";
}
o.keys(H.s.selectors).forEach((sel) => {
myStyle += sel + vis;
});
}
stylesNode[shortcuts.ac](d[shortcuts.ct](myStyle));
d.head[shortcuts.ac](stylesNode);
} else if (stylesNode) {
Expand Down

0 comments on commit dad24d3

Please sign in to comment.