mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Removed Jquery from game list generation
This commit is contained in:
parent
0dfc4e6a61
commit
84e1cb80e1
@ -506,32 +506,24 @@ function showApps(host) {
|
|||||||
// double clicking the button will cause multiple box arts to appear.
|
// double clicking the button will cause multiple box arts to appear.
|
||||||
// to mitigate this we ensure we don't add a duplicate.
|
// to mitigate this we ensure we don't add a duplicate.
|
||||||
// This isn't perfect: there's lots of RTTs before the logic prevents anything
|
// This isn't perfect: there's lots of RTTs before the logic prevents anything
|
||||||
var outerDiv = $("<div>", {
|
var gameCard = document.createElement('div')
|
||||||
class: 'game-container mdl-card mdl-shadow--4dp',
|
gameCard.id = 'game-' + app.id
|
||||||
id: 'game-' + app.id,
|
gameCard.className = 'game-container mdl-card mdl-shadow--4dp'
|
||||||
role: 'link',
|
gameCard.setAttribute('role', 'link')
|
||||||
tabindex: 0,
|
gameCard.tabIndex = 0
|
||||||
title: app.title,
|
gameCard.title = app.title
|
||||||
'aria-label': app.title
|
|
||||||
});
|
|
||||||
|
|
||||||
$(outerDiv).append($("<div>", {
|
gameCard.innerHTML = `<div class="game-title">${app.title}</div>`
|
||||||
class: "game-title",
|
|
||||||
html: $("<span>", {
|
|
||||||
html: app.title
|
|
||||||
})
|
|
||||||
}));
|
|
||||||
$("#game-grid").append(outerDiv);
|
|
||||||
|
|
||||||
$('#game-' + app.id).on('click', function() {
|
gameCard.addEventListener('click', e => {
|
||||||
startGame(host, app.id);
|
startGame(host, app.id)
|
||||||
});
|
})
|
||||||
$('#game-' + app.id).keypress(function(e) {
|
gameCard.addEventListener('keydown', e => {
|
||||||
if (e.keyCode == 13) {
|
if(e.key == "Enter") {
|
||||||
startGame(host, app.id);
|
startGame(host, app.id);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
document.querySelector('#game-grid').appendChild(gameCard);
|
||||||
// apply CSS stylization to indicate whether the app is active
|
// apply CSS stylization to indicate whether the app is active
|
||||||
stylizeBoxArt(host, app.id);
|
stylizeBoxArt(host, app.id);
|
||||||
}
|
}
|
||||||
@ -543,7 +535,7 @@ function showApps(host) {
|
|||||||
img.src = 'static/res/placeholder_error.svg'
|
img.src = 'static/res/placeholder_error.svg'
|
||||||
});
|
});
|
||||||
img.onload = e => img.classList.add('fade-in');
|
img.onload = e => img.classList.add('fade-in');
|
||||||
$(outerDiv).append(img);
|
$(gameCard).append(img);
|
||||||
});
|
});
|
||||||
}, function(failedAppList) {
|
}, function(failedAppList) {
|
||||||
$('#naclSpinner').hide();
|
$('#naclSpinner').hide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user