mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-10 14:46:20 +02:00
cssmanager: Simplify iteration over style sheets
This commit is contained in:
parent
cb9f6d6776
commit
5b05ee79ff
@ -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…
x
Reference in New Issue
Block a user