Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added_disabled_property_to_blockHelp_div #3530

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ class Block {
this.clampCount[clamp] += plusMinus;
this._newArtwork(plusMinus);
this.regenerateArtwork(false);
console.log("replace_new_new");
}

/**
Expand Down Expand Up @@ -908,6 +909,7 @@ class Block {
// Get the block labels from the protoblock.
const that = this;
const thisBlock = this.blocks.blockList.indexOf(this);
console.log(thisBlock);
let block_label = "";

// Create the highlight bitmap for the block.
Expand Down Expand Up @@ -946,6 +948,7 @@ class Block {
that._finishImageLoad();
} else {
if (that.isCollapsible()) {
console.log(thisBlock);
that._ensureDecorationOnTop();
}

Expand All @@ -959,6 +962,7 @@ class Block {
that.bitmap.visible = !that.collapsed;
that.highlightBitmap.visible = false;
that.updateCache();
console.log(thisBlock);
}

if (that.postProcess != null) {
Expand Down
18 changes: 15 additions & 3 deletions js/widgets/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ class HelpWidget {
* @returns {void}
*/
_prepareBlockList() {
console.log("prepare block list");
for (const key in this.activity.blocks.protoBlockDict) {
if (
this.activity.blocks.protoBlockDict[key].beginnerModeBlock === true &&
Expand Down Expand Up @@ -393,6 +394,7 @@ class HelpWidget {
* @returns {void}
*/
_blockHelp(block) {
console.log("block_help");
const widgetWindow = window.widgetWindows.windowFor(this, "help", "help");
this.widgetWindow = widgetWindow;
widgetWindow.clear();
Expand All @@ -411,23 +413,30 @@ class HelpWidget {
let cell = docById("right-arrow");
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') {
leftArrow.click();
} else if (event.key === 'ArrowRight') {
rightArrow.click();
}
} ;
};

if(this.index == this.appendedBlockList.length - 1)
{
rightArrow.classList.add("disabled") ;       
        }
rightArrow.classList.add("disabled") ;
}
cell.onclick = () => {
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 @@ -439,6 +448,9 @@ class HelpWidget {
if (this.index !== 0) {
this.index -= 1;
}
if(this.index==0){
leftArrow.classList.add("disabled");
}

this._blockHelp(
this.activity.blocks.protoBlockDict[this.appendedBlockList[this.index]]
Expand Down
Loading