mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -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 {
|
||||
throw new Error('Unknown dynamic style container');
|
||||
}
|
||||
const allSheets = win.document.styleSheets;
|
||||
|
||||
for (let i = 0; i < allSheets.length; i++) {
|
||||
const s = allSheets[i];
|
||||
if (s.title === title) {
|
||||
return s;
|
||||
}
|
||||
for (const s of win.document.styleSheets) {
|
||||
if (s.title === title) return s;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue