/*! * VisualEditor UserInterface MenuWidget class. * * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * Create an ve.ui.MenuWidget object. * * @class * @extends ve.ui.Widget * * @constructor * @param {Object} [config] Config options * @cfg {jQuery} [$overlay=this.$$( 'body' )] Container to render menu into * @cfg {jQuery} [$input=this.$$( '' )] Input to bind keyboard handlers to */ ve.ui.MenuWidget = function VeUiMenuWidget( config ) { // Config intialization config = config || {}; // Parent constructor ve.ui.Widget.call( this, config ); // Properties this.isolated = !config.$input; this.$input = config.$input || this.$$( '' ); this.$overlay = config.$overlay || this.$$( 'body' ); this.groups = {}; this.items = {}; this.sequence = []; this.$groups = this.$$( '