mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Fix demo blank when device.vendor undefined
This commit is contained in:
parent
a122c0963e
commit
2eb632f4be
BIN
images/companies/blackberry.png
Normal file
BIN
images/companies/blackberry.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 3.3 KiB |
@ -152,7 +152,6 @@
|
||||
DETECT GPU FROM WEBGL DATA (EXPERIMENTAL FEATURE)
|
||||
</div>
|
||||
<div id="gpu-segment" class="ui tall stacked segment">
|
||||
<div class="ui basic segment">
|
||||
<div class="ui equal width stackable internally celled grid">
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
@ -160,13 +159,8 @@
|
||||
<i class="microchip icon"></i>
|
||||
GPU
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="ui basic segment">
|
||||
<img class="ui tiny centered image" id="gpu-img" src="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="ui center aligned header">
|
||||
<div id="gpu-txt"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -73,9 +73,13 @@ $(document)
|
||||
var vendor = result.device.vendor!=undefined?result.device.vendor:'-';
|
||||
var model = result.device.model!==undefined?result.device.model:'-';
|
||||
$('#device-txt').html('<span class="ui large label">' + vendor + '</span><span class="ui large label">' + model + '</span>');
|
||||
if (result.device.vendor) {
|
||||
$('#device-img').attr('src', 'images/companies/' + result.device.vendor.toLowerCase() + '.png').on('error', function () {
|
||||
$(this).attr('src', 'images/companies/default.png');
|
||||
});
|
||||
} else {
|
||||
$('#device-img').attr('src', 'images/companies/default.png');
|
||||
}
|
||||
} else {
|
||||
$('#device-txt').text('-');
|
||||
$('#device-img').attr('src', 'images/companies/default.png');
|
||||
|
Loading…
x
Reference in New Issue
Block a user