linting admin/groups

v1.18.x
psychobunny 11 years ago
parent 6ea760d636
commit d183e58771

@ -1,9 +1,12 @@
"use strict";
/*global define, templates, socket, ajaxify, app, bootbox*/
define(function() { define(function() {
var Groups = {}; var Groups = {};
Groups.init = function() { Groups.init = function() {
var yourid = templates.get('yourid'), var yourid = templates.get('yourid'),
createEl = $('#create'), createEl = $('#create'),
createModal = $('#create-modal'), createModal = $('#create-modal'),
createSubmitBtn = $('#create-modal-go'), createSubmitBtn = $('#create-modal-go'),
createNameEl = $('#create-group-name'), createNameEl = $('#create-group-name'),
@ -12,7 +15,7 @@ define(function() {
searchResults = detailsModal.find('#group-details-search-results'), searchResults = detailsModal.find('#group-details-search-results'),
groupMembersEl = detailsModal.find('ul.current_members'), groupMembersEl = detailsModal.find('ul.current_members'),
detailsModalSave = detailsModal.find('.btn-primary'), detailsModalSave = detailsModal.find('.btn-primary'),
searchDelay = undefined, searchDelay,
listEl = $('#groups-list'); listEl = $('#groups-list');
createEl.on('click', function() { createEl.on('click', function() {
@ -107,7 +110,9 @@ define(function() {
detailsSearch.on('keyup', function() { detailsSearch.on('keyup', function() {
var searchEl = this; var searchEl = this;
if (searchDelay) clearTimeout(searchDelay); if (searchDelay) {
clearTimeout(searchDelay);
}
searchDelay = setTimeout(function() { searchDelay = setTimeout(function() {
var searchText = searchEl.value, var searchText = searchEl.value,
@ -117,7 +122,9 @@ define(function() {
socket.emit('admin.user.search', searchText, function(err, results) { socket.emit('admin.user.search', searchText, function(err, results) {
if (!err && results && results.users.length > 0) { if (!err && results && results.users.length > 0) {
var numResults = results.users.length, x; var numResults = results.users.length, x;
if (numResults > 4) numResults = 4; if (numResults > 4) {
numResults = 4;
}
resultsEl.empty(); resultsEl.empty();
for (x = 0; x < numResults; x++) { for (x = 0; x < numResults; x++) {

Loading…
Cancel
Save