mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Preserve ordering within type class
This commit is contained in:
@@ -275,9 +275,10 @@ class ThemeManager
|
||||
styleElement.setAttribute('class', type)
|
||||
styleElement.setAttribute('id', styleId)
|
||||
styleElement.textContent = text
|
||||
parentElement = _.last(document.head.querySelectorAll("style.#{type}"))?.parentElement
|
||||
if parentElement?
|
||||
parentElement.appendChild(styleElement)
|
||||
|
||||
elementToInsertBefore = _.last(document.head.querySelectorAll("style.#{type}"))?.nextElementSibling
|
||||
if elementToInsertBefore?
|
||||
document.head.insertBefore(styleElement, elementToInsertBefore)
|
||||
else
|
||||
document.head.appendChild(styleElement)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user