Commit 016cf23e authored by Renfred Harper's avatar Renfred Harper

Change info.js to slide down after info is rendered

parent fdc03f8a
......@@ -35,18 +35,7 @@ $(document).ready(function() {
});
// Displays more info about a restaurant on-click
$(document).on('click', '.grid-box', function() {
// If the user clicks on the same box twice it will close the info menu
grid_id = $(this).attr('id');
if (lastClicked == grid_id){
$('#info-body').slideToggle(300)
}
else {
// Empty the schedule before sliding down in case the new
// schedule is shorter
$('#info-schedule').empty();
$('#info-body').slideDown(300);
lastClicked = grid_id;
}
// Search though the restaurnts object to find the selected restaurant's info
var restaurant;
$.each(restaurants, function(idx, restaurant_i) {
......@@ -97,5 +86,13 @@ $(document).ready(function() {
element = '';
}
}
// If the user clicks on the same box twice it will close the info menu
if (lastClicked == grid_id){
$('#info-body').slideToggle(300)
}
else {
$('#info-body').slideDown(300);
lastClicked = grid_id;
}
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment