|
|
|
@ -2,10 +2,11 @@
|
|
|
|
|
/*global define, socket, app, bootbox, templates, ajaxify, RELATIVE_PATH, Sortable */
|
|
|
|
|
|
|
|
|
|
define('admin/manage/categories', function() {
|
|
|
|
|
var Categories = {}, newCategoryId = -1, sortables, itemTemplate;
|
|
|
|
|
var Categories = {}, newCategoryId = -1, sortables;
|
|
|
|
|
|
|
|
|
|
Categories.init = function() {
|
|
|
|
|
socket.emit('admin.categories.getAll', function(error, payload){
|
|
|
|
|
console.log(payload);
|
|
|
|
|
if(error){
|
|
|
|
|
return app.alertError(error.message);
|
|
|
|
|
}
|
|
|
|
@ -57,12 +58,12 @@ define('admin/manage/categories', function() {
|
|
|
|
|
Categories.render = function(categories){
|
|
|
|
|
var container = $('.categories');
|
|
|
|
|
|
|
|
|
|
if(!categories || categories.length == 0){
|
|
|
|
|
if (!categories || categories.length == 0) {
|
|
|
|
|
$('<div></div>')
|
|
|
|
|
.addClass('alert alert-info text-center')
|
|
|
|
|
.text('You have no active categories.')
|
|
|
|
|
.appendTo(container);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
sortables = {};
|
|
|
|
|
renderList(categories, container, 0);
|
|
|
|
|
}
|
|
|
|
|