mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
cssmanager: Simplify iteration over style sheets
This commit is contained in:
parent
cb9f6d6776
commit
5b05ee79ff
1 changed files with 2 additions and 7 deletions
|
@ -40,13 +40,8 @@ const makeCSSManager = (emptyStylesheetTitle, doc) => {
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Unknown dynamic style container');
|
throw new Error('Unknown dynamic style container');
|
||||||
}
|
}
|
||||||
const allSheets = win.document.styleSheets;
|
for (const s of win.document.styleSheets) {
|
||||||
|
if (s.title === title) return s;
|
||||||
for (let i = 0; i < allSheets.length; i++) {
|
|
||||||
const s = allSheets[i];
|
|
||||||
if (s.title === title) {
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue