Skip to content

Commit

Permalink
chore: replace var and use class instead of style
Browse files Browse the repository at this point in the history
  • Loading branch information
ccailly committed Sep 19, 2024
1 parent a323291 commit c2a5f17
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions js/modules/Discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ export class GlpiDiscover {

#handleBeforeChange(intro) {
// Disable scroll when intro is running
document.body.style.overflow = 'hidden';
$('body').addClass('overflow-hidden');

if (this.steps && this.steps[this._currentStep] && this.steps[this._currentStep].actions) {
var step = this.steps[this._currentStep];
var actions = step.actions;
const step = this.steps[this._currentStep];
const actions = step.actions;

var actionEntries = Object.entries(actions);
for (var i = 0; i < actionEntries.length; i++) {
var action = actionEntries[i][0];
var data = actionEntries[i][1];
const actionEntries = Object.entries(actions);
for (let i = 0; i < actionEntries.length; i++) {
const action = actionEntries[i][0];
const data = actionEntries[i][1];

if (action === 'dropdown-show') {
return this.#handleDropdownShow(data, step, intro);
Expand All @@ -100,7 +100,7 @@ export class GlpiDiscover {
}

#handleDropdownShow(data, step, intro) {
var dropdown = document.querySelector(data);
const dropdown = document.querySelector(data);
if ($(dropdown).length === 0) {
return;
}
Expand Down Expand Up @@ -135,7 +135,7 @@ export class GlpiDiscover {

#handleExit() {
// Enable scroll when intro is finished or skipped
document.body.style.overflow = 'auto';
$('body').removeClass('overflow-hidden');
}

}

0 comments on commit c2a5f17

Please sign in to comment.