Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.adapter_.notifySelected({index});
this.adapter_.closeSurface();
const checkbox = this.adapter_.getCheckboxAtIndex(index);
if (checkbox) {
this.adapter_.toggleCheckbox(/** @type {!HTMLElement} */ (checkbox));
}
// Wait for the menu to close before adding/removing classes that affect styles.
this.closeAnimationEndTimerId_ = setTimeout(() => {
const selectionGroup = this.getSelectionGroup_(listItem);
if (selectionGroup !== null) {
this.handleSelectionGroup_(/** @type {!HTMLElement} */ (selectionGroup), index);
}
}, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);
}
MDCMenuFoundation.prototype.handleItemAction = function (listItem) {
var _this = this;
var index = this.adapter_.getElementIndex(listItem);
if (index < 0) {
return;
}
this.adapter_.notifySelected({ index: index });
this.adapter_.closeSurface();
// Wait for the menu to close before adding/removing classes that affect styles.
this.closeAnimationEndTimerId_ = setTimeout(function () {
// Recompute the index in case the menu contents have changed.
var recomputedIndex = _this.adapter_.getElementIndex(listItem);
if (_this.adapter_.isSelectableItemAtIndex(recomputedIndex)) {
_this.setSelectedIndex(recomputedIndex);
}
}, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);
};
MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function () {