Skip to content
Merged
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
3 changes: 1 addition & 2 deletions core/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ input[type=number] {
cursor: inherit;
}

/* State: hover. */
.blocklyMenuItemHighlight {
.blocklyMenuItem:hover {
background-color: rgba(0,0,0,.1);
}

Expand Down
2 changes: 0 additions & 2 deletions core/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,9 @@ export class Menu {
setHighlighted(item: MenuItem | null) {
const currentHighlighted = this.highlightedItem;
if (currentHighlighted) {
currentHighlighted.setHighlighted(false);
this.highlightedItem = null;
}
if (item) {
item.setHighlighted(true);
this.highlightedItem = item;
// Bring the highlighted item into view. This has no effect if the menu is
// not scrollable.
Expand Down
21 changes: 0 additions & 21 deletions core/menuitem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// Former goog.module ID: Blockly.MenuItem

import * as aria from './utils/aria.js';
import * as dom from './utils/dom.js';
import * as idGenerator from './utils/idgenerator.js';

/**
Expand Down Expand Up @@ -68,7 +67,6 @@ export class MenuItem {
'blocklyMenuItem ' +
(this.enabled ? '' : 'blocklyMenuItemDisabled ') +
(this.checked ? 'blocklyMenuItemSelected ' : '') +
(this.highlight ? 'blocklyMenuItemHighlight ' : '') +
(this.rightToLeft ? 'blocklyMenuItemRtl ' : '');

const content = document.createElement('div');
Expand Down Expand Up @@ -177,25 +175,6 @@ export class MenuItem {
this.checked = checked;
}

/**
* Highlights or unhighlights the component.
*
* @param highlight Whether to highlight or unhighlight the component.
* @internal
*/
setHighlighted(highlight: boolean) {
this.highlight = highlight;
const el = this.getElement();
if (el && this.isEnabled()) {
const name = 'blocklyMenuItemHighlight';
if (highlight) {
dom.addClass(el, name);
} else {
dom.removeClass(el, name);
}
}
}

/**
* Returns true if the menu item is enabled, false otherwise.
*
Expand Down