|
|
@ -1,5 +1,5 @@
|
|
|
|
"use strict";
|
|
|
|
"use strict";
|
|
|
|
/* globals app, define, ajaxify, socket, bootbox, utils */
|
|
|
|
/* globals app, define, ajaxify, socket, bootbox, utils, templates */
|
|
|
|
|
|
|
|
|
|
|
|
define('forum/groups/list', function() {
|
|
|
|
define('forum/groups/list', function() {
|
|
|
|
var Groups = {};
|
|
|
|
var Groups = {};
|
|
|
@ -29,6 +29,32 @@ define('forum/groups/list', function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Group searching
|
|
|
|
|
|
|
|
$('#search-text').on('keydown', function(e) {
|
|
|
|
|
|
|
|
if (e.keyCode === 13) { Groups.search($(this).val()); }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#search-button').on('click', function() {
|
|
|
|
|
|
|
|
Groups.search($(this).siblings('input').val());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Groups.search = function(query) {
|
|
|
|
|
|
|
|
var groupsEl = $('.groups.row');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('groups.search', {
|
|
|
|
|
|
|
|
query: query,
|
|
|
|
|
|
|
|
options: {
|
|
|
|
|
|
|
|
expand: true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, function(err, groups) {
|
|
|
|
|
|
|
|
templates.parse('partials/group_list', {
|
|
|
|
|
|
|
|
groups: groups
|
|
|
|
|
|
|
|
}, function(html) {
|
|
|
|
|
|
|
|
groupsEl.empty().append(html);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return Groups;
|
|
|
|
return Groups;
|
|
|
|