Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Location Bug #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ProblemReporter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<link href='https://fonts.googleapis.com/css?family=Nunito:400,700,300' rel='stylesheet' type='text/css'>
</head>

<body onload="initialize()">
<body onload="initialize();">


<div class="kebab" id="kebab">
Expand Down
17 changes: 7 additions & 10 deletions ProblemReporter/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ function initialize() {
let urlComponents = window.location.href.split('/');
serverURL = urlComponents[0] + "//" + urlComponents[2] + "/" + urlComponents[3];

//Added here since location select2 dropdown is not rendered before this is called
setTimeout(initLocationService, 100);
//TODO have select2 created as the page loads then call initLocationService

// Closes kebab dropdown menu when click elsewhere
window.onclick = function (event) {
if (!event.target.matches('.kebab') && !event.target.matches('.middle') && !event.target.matches('.edges')) {
Expand All @@ -45,7 +41,6 @@ function initialize() {
}
}

// No previous user found, showing login
showLoginDialog();
}

Expand Down Expand Up @@ -102,10 +97,13 @@ function showModule(moduleName) {
document.getElementById("loader").style.display = "block";

// Shows the module after a brief loading period
setTimeout(function () {
document.getElementById(moduleName).style.display = "block";
document.getElementById("loader").style.display = "none";
}, 500);
new Promise(function() {
setTimeout(function() {
document.getElementById(moduleName).style.display = "block";
document.getElementById("loader").style.display = "none";
initLocationService();
}, 100);
});
}

/**
Expand Down Expand Up @@ -532,7 +530,6 @@ function updateLocation() {
mapFrame.setAttribute("src", src);
}


function initLocationService() {
var locationInputElement = document.getElementById('location');
locationInputElement.addEventListener("input", updateLocation);
Expand Down