1

Work in progress

This commit is contained in:
Alex Yatskov 2015-03-03 13:13:02 +09:00
parent facb48f839
commit 6b815840c7

View File

@ -64,17 +64,19 @@
return new Handlebars.SafeString(value == this.value ? 'checked' : ''); return new Handlebars.SafeString(value == this.value ? 'checked' : '');
}); });
categories = { $.getJSON('/query', _ctx.query, function(results) {
0: {description: 'Description1', value: -1}, var profile = {};
1: {description: 'Description2', value: 0}, for (var i = 0, length = results.length; i < length; ++i) {
2: {description: 'Description3', value: 1}, var result = results[i];
}; profile[result.id] = {description: result.description, value: 0};
}
$('#addCategory').click(function() { $('#addCategory').click(function() {
addCategory($('#newCategory').val()); addCategory($('#newCategory').val());
}); });
displayCategories(); displayCategories();
});
} }
$(document).on({ $(document).on({
@ -82,4 +84,4 @@
ajaxStop: function() { $('#spinner').hide(); }, ajaxStop: function() { $('#spinner').hide(); },
ready: onReady() ready: onReady()
}); });
})(window.categories = window.categories || {}); })();