From 34f203b715574cdcfdc66a3b35165db90642faac Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Wed, 8 Jul 2020 02:53:39 +0530 Subject: [PATCH] Fixed login-logout UI --- assets/js/main.js | 10 ++-------- index.html | 31 +++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 0f25c59..d01bbb8 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -300,24 +300,18 @@ // Prevent clicks from inside article from bubbling. $this.on('click', function(event) { - if (!("jugaad" in event.target.dataset)) { - // data attribute doesn't exist event.stopPropagation(); - } - else{ - event.stopPropagation(); - } }); }); // Events. $body.on('click', function(event) { - + if(typeof myFloID != 'undefined'){ // Article visible? Hide. if ($body.hasClass('is-article-visible')) $main._hide(true); - + } }); $window.on('keyup', function(event) { diff --git a/index.html b/index.html index b02e60e..5b3cc9f 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,8 @@

Internships @ RanchiMall

+

+

@@ -238,7 +240,7 @@

Don't have a Private Key yet? Lets get you one

+ style="cursor: pointer;">Click Here

@@ -267,10 +269,8 @@

- - @@ -284,7 +284,8 @@
  • GitHub
  • - + + @@ -9497,6 +9498,12 @@ }) + document.getElementById("logout_button").addEventListener('click', (ev) => { + floDapps.clearCredentials().then((result) => { + alert(result) + location.reload() + }) + }) let myInput = function () { return new Promise((resolve, reject) => { @@ -9509,7 +9516,7 @@ resolve(priv_key_field.value.trim()) } else { - console.log('Please enter correct private key.') + alert('Please enter correct private key.') } }) @@ -9517,6 +9524,7 @@ }) } + @@ -9524,6 +9532,7 @@ function onLoadStartUp() { window.location.href = `${window.location.origin}#signin` + document.querySelector("#signin .close").style.display = 'none' //floDapps.addStartUpFunction('Sample', Promised Function) //floDapps.setAppObjectStores({sampleObs1:{}, sampleObs2:{options{autoIncrement:true, keyPath:'SampleKey'}, Indexes:{sampleIndex:{}}}}) @@ -9531,9 +9540,10 @@ floDapps.setCustomPrivKeyInput(myInput) floDapps.launchStartUp().then(result => { - console.log(result) - console.log(`Welcome FLO_ID: ${myFloID}`) - + document.body.click() + document.querySelector("#signin .close").style.display = 'initial' + document.getElementById('welcome_message_top').innerText = `Welcome` + document.getElementById('welcome_message_bottom').innerText = `${myFloID}` document.getElementById('floid').value = myFloID //App functions.... @@ -9557,8 +9567,8 @@ for (let i = 0; i < projectDetailsKeys.length; i++) { newHtml = `
    - - + +

    ${projectDetails[projectDetailsKeys[i]].projectDescription}

    ` projectlistContainer.innerHTML = projectlistContainer.innerHTML + newHtml @@ -9619,6 +9629,7 @@ }); + }).catch(error => console.error(error)) }