added connect button

pull/20/head
gdorsi 2019-11-12 00:59:52 +01:00
parent 51888d724c
commit 2d702859fa
2 changed files with 8 additions and 4 deletions

View File

@ -35,6 +35,9 @@
<a href="https://banglejs.com" class="navbar-brand mr-2"><img src="img/banglejs-logo-sml.png" alt="Bangle.js">&nbsp;&nbsp;App Loader</a>
<!-- <a href="#" class="btn btn-link">...</a> -->
</section>
<section class="navbar-section">
<button class="btn" id="connectmydevice" style="text-align: right;">Connect</button>
</section>
<!--<section class="navbar-section">
<div class="input-group input-inline">
<input class="form-input" type="text" placeholder="search">

View File

@ -247,11 +247,14 @@ function refreshMyApps() {
});
}
var connectMyDeviceBtn = document.getElementById("connectmydevice");
function getInstalledApps() {
showLoadingIndicator();
// Get apps
Comms.getInstalledApps().then(appIDs => {
appsInstalled = appIDs;
connectMyDeviceBtn.style.display = 'none';
refreshMyApps();
refreshLibrary();
}).catch(err => {
@ -259,10 +262,8 @@ function getInstalledApps() {
});
}
document.getElementById("myappsrefresh").addEventListener("click",event=>{
getInstalledApps();
});
document.getElementById("myappsrefresh").addEventListener("click", getInstalledApps);
connectMyDeviceBtn.addEventListener("click", getInstalledApps);
// =========================================== About