Skip to content

Commit 9893aa3

Browse files
author
Lionel Laské
committed
Fix ESLint issues
1 parent 0e50907 commit 9893aa3

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

dashboard/public/js/tutorial.js

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function sugarizerTour(currentView, role, mode) {
1212

1313
// Init tutorial
1414
tutorial.init = function () {
15-
var steps=[]
15+
var steps=[];
1616
if (currentView == "home") {
1717
lockScroll();
1818
steps.push(getStep("home","", "bottom", 1, true));
@@ -28,6 +28,7 @@ function sugarizerTour(currentView, role, mode) {
2828
}else if (currentView == "users") {
2929
steps.push(getStep("users", "", "bottom", 1, true));
3030
steps.push(getStep("users", "#user-serach-row", "bottom", 2));// Tutorial handling
31+
/* eslint-disable no-inner-declarations */
3132
function sugarizerTour(currentView, role, mode) {
3233
var tutorial = {};
3334
var tour;
@@ -176,23 +177,24 @@ function sugarizerTour(currentView, role, mode) {
176177

177178
steps = steps.filter(function(step) {
178179
return !("element" in step) ||
179-
(step.element.length &&
180+
(step.element.length &&
180181
document.querySelector(step.element) &&
181182
document.querySelector(step.element).style.display != "none" &&
182183
document.querySelector(step.element).getBoundingClientRect().y != 0);
183184
});
184185

186+
/* eslint-disable no-undef */
185187
introJs()
186-
.setOptions({
187-
tooltipClass: "customTooltip",
188-
steps: steps,
189-
prevLabel: document.webL10n.get("TutoPrev"),
190-
nextLabel: document.webL10n.get("TutoNext"),
191-
exitOnOverlayClick: false,
192-
nextToDone: false,
193-
showBullets: false,
194-
})
195-
.start();
188+
.setOptions({
189+
tooltipClass: "customTooltip",
190+
steps: steps,
191+
prevLabel: document.webL10n.get("TutoPrev"),
192+
nextLabel: document.webL10n.get("TutoNext"),
193+
exitOnOverlayClick: false,
194+
nextToDone: false,
195+
showBullets: false,
196+
})
197+
.start();
196198

197199
localStorage.setItem(tutorialName,currentView);
198200
};
@@ -238,7 +240,8 @@ function sugarizerTour(currentView, role, mode) {
238240
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
239241

240242
// Adjust tooltip position if necessary
241-
setTimeout(() => {
243+
setTimeout(function() {
244+
/* eslint-disable no-undef */
242245
introJs().refresh();
243246
}, 500);
244247
}
@@ -260,8 +263,8 @@ function sugarizerTour(currentView, role, mode) {
260263
self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
261264
];
262265
var html = jQuery('html'); // it would make more sense to apply this to body, but IE7 won't have that
263-
html.data('scroll-position', scrollPosition);
264-
html.data('previous-overflow', html.css('overflow'));
266+
html.data('scroll-position', scrollPosition);
267+
html.data('previous-overflow', html.css('overflow'));
265268
html.css('overflow', 'hidden');
266269
window.scrollTo(scrollPosition[0], scrollPosition[1]);
267270
}
@@ -393,28 +396,28 @@ function sugarizerTour(currentView, role, mode) {
393396
steps.push(getStep("editChart", "#editChart-display", "right", 5));
394397
}
395398

396-
steps = steps.filter(
397-
(step) =>
398-
!("element" in step) ||
399-
(step.element.length &&
399+
steps = steps.filter(function(step) {
400+
return !("element" in step) ||
401+
(step.element.length &&
400402
document.querySelector(step.element) &&
401403
document.querySelector(step.element).style.display != "none" &&
402-
document.querySelector(step.element).getBoundingClientRect().y != 0)
403-
);
404+
document.querySelector(step.element).getBoundingClientRect().y != 0);
405+
});
404406

405-
introJs()
406-
.setOptions({
407-
tooltipClass: "customTooltip",
408-
steps: steps,
409-
prevLabel: document.webL10n.get("TutoPrev"),
410-
nextLabel: document.webL10n.get("TutoNext"),
411-
exitOnOverlayClick: false,
412-
nextToDone: false,
413-
showBullets: false,
414-
})
415-
.start();
416-
417-
localStorage.setItem(tutorialName,currentView);
407+
/* eslint-disable no-undef */
408+
introJs()
409+
.setOptions({
410+
tooltipClass: "customTooltip",
411+
steps: steps,
412+
prevLabel: document.webL10n.get("TutoPrev"),
413+
nextLabel: document.webL10n.get("TutoNext"),
414+
exitOnOverlayClick: false,
415+
nextToDone: false,
416+
showBullets: false,
417+
})
418+
.start();
419+
420+
localStorage.setItem(tutorialName,currentView);
418421
};
419422

420423
// Start tutorial
@@ -462,7 +465,8 @@ function sugarizerTour(currentView, role, mode) {
462465
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
463466

464467
// Adjust tooltip position if necessary
465-
setTimeout(() => {
468+
setTimeout(function() {
469+
/* eslint-disable no-undef */
466470
introJs().refresh();
467471
}, 500);
468472
}

0 commit comments

Comments
 (0)