mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
config.html: Fix select boxes to reflect actual values in mt-daapd.conf
Handle config.xml default_value for select boxes
This commit is contained in:
parent
c8b10769a2
commit
b150896921
@ -109,10 +109,14 @@ var Config = {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'select':
|
case 'select':
|
||||||
|
var value = Config._getConfigOptionValue(itemId);
|
||||||
|
if (!value) {
|
||||||
|
value = Element.textContent(item.getElementsByTagName('default_value')[0]);
|
||||||
|
}
|
||||||
ret = BuildElement.select(itemId,
|
ret = BuildElement.select(itemId,
|
||||||
Element.textContent(item.getElementsByTagName('name')[0]),
|
Element.textContent(item.getElementsByTagName('name')[0]),
|
||||||
item.getElementsByTagName('option'),
|
item.getElementsByTagName('option'),
|
||||||
Config._getConfigOptionValue(itemId),
|
value,
|
||||||
Element.textContent(item.getElementsByTagName('short_description')[0])
|
Element.textContent(item.getElementsByTagName('short_description')[0])
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@ -135,6 +139,7 @@ var BuildElement = {
|
|||||||
frag.appendChild(document.createTextNode('\u00a0'));
|
frag.appendChild(document.createTextNode('\u00a0'));
|
||||||
frag.appendChild(document.createTextNode(short_description));
|
frag.appendChild(document.createTextNode(short_description));
|
||||||
frag.appendChild(Builder.node('br'));
|
frag.appendChild(Builder.node('br'));
|
||||||
|
|
||||||
return frag;
|
return frag;
|
||||||
},
|
},
|
||||||
select: function(id,displayName,options,value,short_description,long_description) {
|
select: function(id,displayName,options,value,short_description,long_description) {
|
||||||
@ -149,10 +154,12 @@ var BuildElement = {
|
|||||||
select.appendChild(Builder.node('option',{value: option.getAttribute('value')},
|
select.appendChild(Builder.node('option',{value: option.getAttribute('value')},
|
||||||
Element.textContent(option)));
|
Element.textContent(option)));
|
||||||
});
|
});
|
||||||
|
select.value = value;
|
||||||
frag.appendChild(select);
|
frag.appendChild(select);
|
||||||
frag.appendChild(document.createTextNode('\u00a0'));
|
frag.appendChild(document.createTextNode('\u00a0'));
|
||||||
frag.appendChild(document.createTextNode(short_description));
|
frag.appendChild(document.createTextNode(short_description));
|
||||||
frag.appendChild(Builder.node('br'));
|
frag.appendChild(Builder.node('br'));
|
||||||
|
|
||||||
return frag;
|
return frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user