Page MenuHomeWickedGov Phorge

InvestigateMenuSelectWidget.js
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

InvestigateMenuSelectWidget.js

/**
* Investigate Menu Select Widget
*
* @class
*
* @constructor
* @param {Object} [config] Configuration options
*/
const InvestigateMenuSelectWidget = function ( config ) {
// Parent constructor
InvestigateMenuSelectWidget.super.call( this, config );
};
/* Setup */
OO.inheritClass( InvestigateMenuSelectWidget, OO.ui.MenuSelectWidget );
/**
* @inheritdoc
*/
InvestigateMenuSelectWidget.prototype.onDocumentMouseUp = function ( e ) {
if ( !this.selecting ) {
const item = this.findTargetItem( e );
if ( item && item.isSelectable() ) {
this.selecting = item;
}
}
if ( !this.isDisabled() && e.which === OO.ui.MouseButtons.LEFT && this.selecting ) {
this.emit( 'investigate', this.selecting );
}
return InvestigateMenuSelectWidget.super.prototype.onDocumentMouseUp.call( this, e );
};
/**
* @inheritdoc
*/
InvestigateMenuSelectWidget.prototype.onDocumentKeyDown = function ( e ) {
const selected = this.findSelectedItems(),
currentItem = this.findHighlightedItem() || (
Array.isArray( selected ) ? selected[ 0 ] : selected
);
if ( e.keyCode === OO.ui.Keys.ENTER ) {
this.emit( 'investigate', currentItem );
}
return InvestigateMenuSelectWidget.super.prototype.onDocumentKeyDown.call( this, e );
};
module.exports = InvestigateMenuSelectWidget;

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 19, 08:53 (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ad/24/30226ce695e91e7bdbdd654c6e12
Default Alt Text
InvestigateMenuSelectWidget.js (1 KB)

Event Timeline