Skip to content

Commit

Permalink
block_left_arrow_active
Browse files Browse the repository at this point in the history
  • Loading branch information
kaurjasleen240305 committed Jan 7, 2024
1 parent af38355 commit 976e4cd
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions js/widgets/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ class HelpWidget {
let rightArrow = docById("right-arrow");
let leftArrow = docById("left-arrow");

if(this.index==0){
leftArrow.classList.add("disabled");
}

document.onkeydown = function handleArrowKeys(event) {
if (event.key === 'ArrowLeft') {
Expand All @@ -432,9 +429,6 @@ class HelpWidget {
if (this.index !== this.appendedBlockList.length - 1) {
this.index += 1;
}
if(this.index==1){
leftArrow.classList.remove("disabled");
}
this._blockHelp(
this.activity.blocks.protoBlockDict[this.appendedBlockList[this.index]]
);
Expand All @@ -443,16 +437,19 @@ class HelpWidget {
cell = docById("left-arrow");

cell.onclick = () => {
if (this.index !== 0) {
this.index -= 1;
}
if(this.index==0){
leftArrow.classList.add("disabled");
const widgetWindow = window.widgetWindows.windowFor(this, "help", "help");
this.widgetWindow = widgetWindow;
widgetWindow.clear();
this._helpDiv = document.createElement("div");
this._setup(false);
}

this._blockHelp(
else{
this.index-=1;
this._blockHelp(
this.activity.blocks.protoBlockDict[this.appendedBlockList[this.index]]
);
);
}
};
if (block.name !== null) {
const label = block.staticLabels[0];
Expand Down

0 comments on commit 976e4cd

Please sign in to comment.