Commit 82da056f authored by Tyler Hallada's avatar Tyler Hallada

Fix bugs with generating the grid. Ignore .swo.

parent 19358427
......@@ -2,7 +2,7 @@
*.pot
*.py[cod]
*.db
*.swp
*.sw[po]
*.log
*.env
venv
......
......@@ -13,15 +13,17 @@ function open(id) {
$.ajax({
url: '/ajax/schedule/',
}).done(function (data) {
$('#grid').append('<div class="row"></div>');
$('#grid').empty();
$('#grid').html('<div class="row"></div>');
$.each(data.data, function (idx, restaurant) {
// Note: This assumes grid does not already exist. TODO do not assume.
// Append the data into the Bootstrap scaffolding
if ($('#grid .row').last().children().length < 4) {
$('#grid .row').append(
$('#grid .row').last().append(
'<div class="span3 closed" id="' + restaurant.id + '">' + restaurant.name + '</div>'
);
} else {
$('#grid').append('<div class="row"></div>').append(
$('#grid').append('<div class="row"></div>');
$('#grid .row').last().append(
'<div class="span3 closed" id="' + restaurant.id + '">' + restaurant.name + '</div>'
);
}
......
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