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 // Group searching
$('#search-text').on('keydown', function(e) { $('#search-text').on('keydown', function(e) {
if (e.keyCode === 13) { Groups.search($(this).val()); } if (e.keyCode === 13) { Groups.search(); }
});
$('#search-button').on('click', function() {
Groups.search($(this).siblings('input').val());
}); });
$('#search-button').on('click', Groups.search);
}; };
Groups.search = function(query) { Groups.search = function() {
var groupsEl = $('#groups-list'); var groupsEl = $('#groups-list'),
queryEl = $('#search-text');
socket.emit('groups.search', { socket.emit('groups.search', {
query: query, query: queryEl.val(),
options: { options: {
expand: true expand: true
} }

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

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

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

Loading…
Cancel
Save