1 Demo.SearchWidgetDialog = function DemoSearchWidgetDialog( config ) {
2 Demo.SearchWidgetDialog.parent.call( this, config );
5 OO.inheritClass( Demo.SearchWidgetDialog, OO.ui.ProcessDialog );
6 Demo.SearchWidgetDialog.static.title = 'Search widget dialog';
7 Demo.SearchWidgetDialog.prototype.initialize = function () {
8 var i, items, searchWidget;
9 Demo.SearchWidgetDialog.parent.prototype.initialize.apply( this, arguments );
11 searchWidget = new OO.ui.SearchWidget();
12 for ( i = 1; i <= 20; i++ ) {
13 items.push( new OO.ui.OptionWidget( { data: i, label: 'Item ' + i } ) );
15 searchWidget.results.addItems( items );
16 searchWidget.onQueryChange = function () {};
17 this.$body.append( searchWidget.$element );
19 Demo.SearchWidgetDialog.prototype.getBodyHeight = function () {
22 Demo.SearchWidgetDialog.static.actions = [
23 { action: 'cancel', label: 'Cancel', flags: [ 'safe', 'back' ] }
25 Demo.SearchWidgetDialog.prototype.getActionProcess = function ( action ) {
27 return new OO.ui.Process( function () {
28 dialog.close( { action: action } );