1 Demo.DialogWithPopupAndDropdown = function DemoDialogWithPopupAndDropdown( config ) {
2 Demo.DialogWithPopupAndDropdown.parent.call( this, config );
4 OO.inheritClass( Demo.DialogWithPopupAndDropdown, OO.ui.ProcessDialog );
5 Demo.DialogWithPopupAndDropdown.static.title = 'Dialog with popup and dropdown (ClippableElement test)';
6 Demo.DialogWithPopupAndDropdown.static.actions = [
7 { action: 'save', label: 'Done', flags: [ 'primary', 'progressive' ] },
8 { action: 'cancel', label: 'Cancel', flags: [ 'safe', 'back' ] }
10 Demo.DialogWithPopupAndDropdown.prototype.getBodyHeight = function () {
13 Demo.DialogWithPopupAndDropdown.prototype.initialize = function () {
14 var $spacer = $( '<div>' ).height( 240 );
15 Demo.DialogWithPopupAndDropdown.parent.prototype.initialize.apply( this, arguments );
16 this.bookletLayout = new OO.ui.BookletLayout( {
20 new Demo.SamplePage( 'info', {
24 'Widgets that don\'t use $overlay get clipped at the bottom of their container. ',
25 'This is a test of two such cases'
28 new Demo.SamplePage( 'dropdownbottom', {
29 label: 'DropdownWidget at bottom',
30 content: [ $spacer.clone(), new OO.ui.DropdownWidget( {
32 items: this.makeItems()
36 new Demo.SamplePage( 'popupbottom', {
37 label: 'Popup at bottom',
38 content: [ $spacer.clone(), new OO.ui.PopupButtonWidget( {
44 label: 'More information',
45 $content: $( '<p>Extra information here.</p>' ),
51 this.bookletLayout.addPages( this.pages );
52 this.$body.append( this.bookletLayout.$element );
54 Demo.DialogWithPopupAndDropdown.prototype.makeItems = function () {
55 return [ 0, 1, 2, 3, 4 ].map( function ( val ) {
56 return new OO.ui.MenuOptionWidget( {
63 Demo.DialogWithPopupAndDropdown.prototype.getActionProcess = function ( action ) {
65 return new OO.ui.Process( function () {
66 this.close( { action: action } );
69 return Demo.DialogWithPopupAndDropdown.parent.prototype.getActionProcess.call( this, action );