Commit f34ae161 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: jslint

parent e84973af
/*jslint indent: 2, maxerr: 3, nomen: true, maxlen: 80 */ /*jslint indent: 2, maxerr: 3, nomen: true, maxlen: 80 */
/*global window, rJS, RSVP, URI, /*global window, rJS, RSVP, URI,
SimpleQuery, ComplexQuery, Query, QueryFactory, document, XMLHttpRequest, SimpleQuery, ComplexQuery, Query, QueryFactory, document, XMLHttpRequest,
console*/ console, MouseEvent */
(function (window, rJS, RSVP, URI, document, (function (window, rJS, RSVP, URI, document,
SimpleQuery, ComplexQuery, Query, QueryFactory, XMLHttpRequest, console, SimpleQuery, ComplexQuery, Query, QueryFactory, XMLHttpRequest, console,
MouseEvent) { MouseEvent) {
...@@ -551,10 +551,10 @@ ...@@ -551,10 +551,10 @@
}, false, false) }, false, false)
.onEvent('keydown', function (evt) { .onEvent('keydown', function (evt) {
var gadget = this, var gadget = this,
i, i,
next_event, next_event,
active_index, active_index,
ul = gadget.element.querySelector(".search_ul"); ul = gadget.element.querySelector(".search_ul");
if (evt.key === "ArrowDown" || evt.key === "ArrowUp") { if (evt.key === "ArrowDown" || evt.key === "ArrowUp") {
if (ul.childNodes.length > 0) { if (ul.childNodes.length > 0) {
for (i = 0; i < ul.childNodes.length; i += 1) { for (i = 0; i < ul.childNodes.length; i += 1) {
...@@ -576,8 +576,7 @@ ...@@ -576,8 +576,7 @@
} }
if (active_index >= ul.childNodes.length) { if (active_index >= ul.childNodes.length) {
active_index = 0; active_index = 0;
} } else if (active_index === -1) {
else if (active_index === -1) {
active_index = ul.childNodes.length - 1; active_index = ul.childNodes.length - 1;
} }
} }
...@@ -613,8 +612,8 @@ ...@@ -613,8 +612,8 @@
// Do not use li:hover css syntax, since we have to disable manually // Do not use li:hover css syntax, since we have to disable manually
// the highlightnment when keyboard is used // the highlightnment when keyboard is used
var gadget = this, var gadget = this,
i, i,
ul = gadget.element.querySelector(".search_ul"); ul = gadget.element.querySelector(".search_ul");
if (evt.target.tagName.toLowerCase() === 'li') { if (evt.target.tagName.toLowerCase() === 'li') {
for (i = 0; i < ul.childNodes.length; i += 1) { for (i = 0; i < ul.childNodes.length; i += 1) {
ul.childNodes[i].classList.remove('active'); ul.childNodes[i].classList.remove('active');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment