Merge branch 'master' into 0.7.0

Conflicts:
	public/src/client/groups/list.js
v1.18.x
Julian Lam 10 years ago
commit be30dcc2d0

@ -32,19 +32,17 @@ 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());
if (e.keyCode === 13) { Groups.search(); }
});
$('#search-button').on('click', Groups.search);
};
Groups.search = function(query) {
var groupsEl = $('#groups-list');
Groups.search = function() {
var groupsEl = $('#groups-list'),
queryEl = $('#search-text');
socket.emit('groups.search', {
query: query,
query: queryEl.val(),
options: {
expand: true
}

@ -96,13 +96,11 @@ define('forum/users', function() {
timeoutId = setTimeout(doSearch, 250);
});
$('.search select, .search .checkbox input').on('change', function() {
console.log('doing search');
$('.search select, .search input[type="checkbox"]').on('change', function() {
doSearch();
});
$('.pagination').on('click', 'a', function() {
console.log('loading page', $(this).attr('data-page'));
doSearch($(this).attr('data-page'));
return false;
})

@ -878,8 +878,8 @@ var async = require('async'),
};
Groups.search = function(query, options, callback) {
if (!query || !query.length) {
return callback(null, []);
if (!query) {
query = '';
}
async.waterfall([

@ -127,11 +127,11 @@ SocketGroups.delete = function(socket, data, callback) {
};
SocketGroups.search = function(socket, data, callback) {
if (!data || !data.query) {
if (!data) {
return callback(null, []);
}
groups.search(data.query, data.options || {}, callback);
groups.search(data.query || '', data.options || {}, callback);
};
SocketGroups.cover = {};

Loading…
Cancel
Save