change position of return (#1374)
Cette révision appartient à :
Parent
2052f2370c
révision
4f00f74859
1 fichiers modifiés avec 6 ajouts et 3 suppressions
|
@ -6,14 +6,17 @@
|
||||||
function switchThemes() {
|
function switchThemes() {
|
||||||
var themeName = document.getElementById("theme-selector").value
|
var themeName = document.getElementById("theme-selector").value
|
||||||
var head = document.getElementsByTagName("head")[0]
|
var head = document.getElementsByTagName("head")[0]
|
||||||
|
|
||||||
|
if (themeName === "") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the theme in place, it fails if one isn't set
|
// Remove the theme in place, it fails if one isn't set
|
||||||
try {
|
try {
|
||||||
head.removeChild(document.getElementById("theme"))
|
head.removeChild(document.getElementById("theme"))
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
// Don't add a node if we don't want extra styling
|
// Don't add a node if we don't want extra styling
|
||||||
if (themeName === "") {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Create the new one and put it back
|
// Create the new one and put it back
|
||||||
var newTheme = document.createElement("link")
|
var newTheme = document.createElement("link")
|
||||||
newTheme.setAttribute("rel", "stylesheet")
|
newTheme.setAttribute("rel", "stylesheet")
|
||||||
|
|
Référencer dans un nouveau ticket