Skip to content

Commit 06fb242

Browse files
committed
fix mistakes
1 parent b5f3dfa commit 06fb242

6 files changed

Lines changed: 54 additions & 18 deletions

File tree

apps/_dashboard/static/js/utils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272
return throttledEventHandler;
273273
};
274274

275-
// parse a comma separated list of strings which may be quoted
275+
/**
276+
* parse a comma separated list of strings which may be quoted
277+
* @param {string} line
278+
* @returns
279+
*/
276280
Q.parse_list = function (line) {
281+
// handle empty string case
282+
if (line.length === 0) return [];
277283
let a = [],
278284
i = 0,
279285
s = "",
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320
Q.tags_input = function (elem_arg, options) {
315321
/** @type {HTMLInputElement} */
316322
let elem;
317-
if (typeof elem === "string") {
323+
if (typeof elem_arg === "string") {
318324
// @ts-ignore
319-
elem = Q(elem)[0];
325+
elem = Q(elem_arg)[0];
320326
if (!elem) {
321327
console.log("Q.tags_input: elem " + elem_arg + " not found");
322328
return;

apps/_scaffold/static/js/utils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272
return throttledEventHandler;
273273
};
274274

275-
// parse a comma separated list of strings which may be quoted
275+
/**
276+
* parse a comma separated list of strings which may be quoted
277+
* @param {string} line
278+
* @returns
279+
*/
276280
Q.parse_list = function (line) {
281+
// handle empty string case
282+
if (line.length === 0) return [];
277283
let a = [],
278284
i = 0,
279285
s = "",
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320
Q.tags_input = function (elem_arg, options) {
315321
/** @type {HTMLInputElement} */
316322
let elem;
317-
if (typeof elem === "string") {
323+
if (typeof elem_arg === "string") {
318324
// @ts-ignore
319-
elem = Q(elem)[0];
325+
elem = Q(elem_arg)[0];
320326
if (!elem) {
321327
console.log("Q.tags_input: elem " + elem_arg + " not found");
322328
return;

apps/fadebook/static/js/utils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272
return throttledEventHandler;
273273
};
274274

275-
// parse a comma separated list of strings which may be quoted
275+
/**
276+
* parse a comma separated list of strings which may be quoted
277+
* @param {string} line
278+
* @returns
279+
*/
276280
Q.parse_list = function (line) {
281+
// handle empty string case
282+
if (line.length === 0) return [];
277283
let a = [],
278284
i = 0,
279285
s = "",
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320
Q.tags_input = function (elem_arg, options) {
315321
/** @type {HTMLInputElement} */
316322
let elem;
317-
if (typeof elem === "string") {
323+
if (typeof elem_arg === "string") {
318324
// @ts-ignore
319-
elem = Q(elem)[0];
325+
elem = Q(elem_arg)[0];
320326
if (!elem) {
321327
console.log("Q.tags_input: elem " + elem_arg + " not found");
322328
return;

apps/showcase/static/js/utils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272
return throttledEventHandler;
273273
};
274274

275-
// parse a comma separated list of strings which may be quoted
275+
/**
276+
* parse a comma separated list of strings which may be quoted
277+
* @param {string} line
278+
* @returns
279+
*/
276280
Q.parse_list = function (line) {
281+
// handle empty string case
282+
if (line.length === 0) return [];
277283
let a = [],
278284
i = 0,
279285
s = "",
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320
Q.tags_input = function (elem_arg, options) {
315321
/** @type {HTMLInputElement} */
316322
let elem;
317-
if (typeof elem === "string") {
323+
if (typeof elem_arg === "string") {
318324
// @ts-ignore
319-
elem = Q(elem)[0];
325+
elem = Q(elem_arg)[0];
320326
if (!elem) {
321327
console.log("Q.tags_input: elem " + elem_arg + " not found");
322328
return;

apps/tagged_posts/static/js/utils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272
return throttledEventHandler;
273273
};
274274

275-
// parse a comma separated list of strings which may be quoted
275+
/**
276+
* parse a comma separated list of strings which may be quoted
277+
* @param {string} line
278+
* @returns
279+
*/
276280
Q.parse_list = function (line) {
281+
// handle empty string case
282+
if (line.length === 0) return [];
277283
let a = [],
278284
i = 0,
279285
s = "",
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320
Q.tags_input = function (elem_arg, options) {
315321
/** @type {HTMLInputElement} */
316322
let elem;
317-
if (typeof elem === "string") {
323+
if (typeof elem_arg === "string") {
318324
// @ts-ignore
319-
elem = Q(elem)[0];
325+
elem = Q(elem_arg)[0];
320326
if (!elem) {
321327
console.log("Q.tags_input: elem " + elem_arg + " not found");
322328
return;

apps/todo/static/js/utils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@ Q.throttle = (callback, delay) => {
272272
return throttledEventHandler;
273273
};
274274

275-
// parse a comma separated list of strings which may be quoted
275+
/**
276+
* parse a comma separated list of strings which may be quoted
277+
* @param {string} line
278+
* @returns
279+
*/
276280
Q.parse_list = function (line) {
281+
// handle empty string case
282+
if (line.length === 0) return [];
277283
let a = [],
278284
i = 0,
279285
s = "",
@@ -314,9 +320,9 @@ Q.parse_list = function (line) {
314320
Q.tags_input = function (elem_arg, options) {
315321
/** @type {HTMLInputElement} */
316322
let elem;
317-
if (typeof elem === "string") {
323+
if (typeof elem_arg === "string") {
318324
// @ts-ignore
319-
elem = Q(elem)[0];
325+
elem = Q(elem_arg)[0];
320326
if (!elem) {
321327
console.log("Q.tags_input: elem " + elem_arg + " not found");
322328
return;

0 commit comments

Comments
 (0)