client/general: fix JSCS warnings

This commit is contained in:
rr- 2016-05-10 14:13:24 +02:00
parent 27533483b2
commit 3856e9fd0d
6 changed files with 15 additions and 13 deletions

View File

@ -45,6 +45,7 @@ Promise.all([tags.refreshExport(), api.loginFromCookies()])
page('/'); page('/');
events.notify( events.notify(
events.Error, events.Error,
'An error happened while trying to log you in: ' + errorMessage); 'An error happened while trying to log you in: ' +
errorMessage);
} }
}); });

View File

@ -7,8 +7,7 @@ const events = require('./events.js');
let _export = null; let _export = null;
let _stylesheet = null; let _stylesheet = null;
function _tagsToDictionary(tags) function _tagsToDictionary(tags) {
{
let dict = {}; let dict = {};
for (let tag of tags) { for (let tag of tags) {
for (let name of tag.names) { for (let name of tag.names) {
@ -18,8 +17,7 @@ function _tagsToDictionary(tags)
return dict; return dict;
} }
function _tagCategoriesToDictionary(categories) function _tagCategoriesToDictionary(categories) {
{
let dict = {}; let dict = {};
for (let category of categories) { for (let category of categories) {
dict[category.name] = category; dict[category.name] = category;

View File

@ -78,8 +78,8 @@ function makeSelect(options) {
} }
function makeInput(options) { function makeInput(options) {
return _makeLabel(options) return _makeLabel(options) +
+ makeVoidElement( makeVoidElement(
'input', { 'input', {
type: options.inputType, type: options.inputType,
name: options.name, name: options.name,
@ -120,7 +120,8 @@ function makeColorInput(options) {
type: 'color', type: 'color',
value: options.value || '', value: options.value || '',
}); });
return makeNonVoidElement('label', {class: 'color'}, colorInput + textInput); return makeNonVoidElement(
'label', {class: 'color'}, colorInput + textInput);
} }
function makeTagLink(name) { function makeTagLink(name) {

View File

@ -116,10 +116,12 @@ class EndlessPageView {
'.page-content-holder'); '.page-content-holder');
ctx.pageRenderer.render(pageRendererCtx); ctx.pageRenderer.render(pageRendererCtx);
if (pageNumber < this.minPageShown || this.minPageShown === null) { if (pageNumber < this.minPageShown ||
this.minPageShown === null) {
this.minPageShown = pageNumber; this.minPageShown = pageNumber;
} }
if (pageNumber > this.maxPageShown || this.maxPageShown === null) { if (pageNumber > this.maxPageShown ||
this.maxPageShown === null) {
this.maxPageShown = pageNumber; this.maxPageShown = pageNumber;
} }

View File

@ -19,7 +19,7 @@ class HelpView {
'users': views.getTemplate('help-search-users'), 'users': views.getTemplate('help-search-users'),
'tags': views.getTemplate('help-search-tags'), 'tags': views.getTemplate('help-search-tags'),
} }
} };
} }
render(ctx) { render(ctx) {

View File

@ -37,8 +37,8 @@ class TagListHeaderView {
} }
} else { } else {
const existingCategory = existingCategories[name]; const existingCategory = existingCategories[name];
if (existingCategory.color !== category.color if (existingCategory.color !== category.color ||
|| existingCategory.name !== category.name) { existingCategory.name !== category.name) {
changedCategories.push(category); changedCategories.push(category);
} }
} }