add data attr

This commit is contained in:
labcode-de 2017-09-23 20:40:47 +02:00
parent 7d778934f5
commit 28b99e2aa4
No known key found for this signature in database
GPG Key ID: 9CDB093B80490C2F

View File

@ -83,12 +83,17 @@ function change (origin, select) {
.material_select(); .material_select();
} }
else if(origin === 'version') { else if(origin === 'version') {
var id = $('#version').val()
$('#entwicklungsstadium') $('#entwicklungsstadium')
.attr('disabled', '') .attr('disabled', '')
.material_select() .material_select()
$('#erstinstallation').html("<option disabled selected value=''>Firmware Erstinstallation?</option>" + $('#erstinstallation').html("<option disabled selected value=''>Firmware Erstinstallation?</option>")
"<option value='" + $(select).val() +"J'>Ja</option>" + if(router_json[id].stablefactory === 1) {
"<option value='" + $(select).val() +"N'>Nein</option>") $('#erstinstallation').append('<option value="' + $(select).val() + 'J" data-value="yes">Ja</option>');
}
if(router_json[id].stablesysupgrade === 1) {
$('#erstinstallation').append('<option value="' + $(select).val() + 'N" data-value="no">Nein</option>');
}
$('#erstinstallation').removeAttr('disabled') $('#erstinstallation').removeAttr('disabled')
$('#erstinstallation').material_select() $('#erstinstallation').material_select()
$('#img_router_front').attr("src", router_json[$(select).val()].imagefront) $('#img_router_front').attr("src", router_json[$(select).val()].imagefront)
@ -98,7 +103,6 @@ function change (origin, select) {
var stadium = $('#entwicklungsstadium') var stadium = $('#entwicklungsstadium')
stadium.html("<option disabled value=''>Firmware Entwicklungsstadium?</option>") stadium.html("<option disabled value=''>Firmware Entwicklungsstadium?</option>")
var id = $('#version').val() var id = $('#version').val()
console.log(router_json[id])
if (router_json[id].stablefactory == 1) { if (router_json[id].stablefactory == 1) {
stadium.append("<option selected value='" + $(select).val() +"stable'>Stabil &#040;empfohlen&#041;</option>") stadium.append("<option selected value='" + $(select).val() +"stable'>Stabil &#040;empfohlen&#041;</option>")
} }