1 Demo.IndexedDialog = function DemoIndexedDialog( config ) {
2 Demo.IndexedDialog.parent.call( this, config );
4 OO.inheritClass( Demo.IndexedDialog, OO.ui.ProcessDialog );
5 Demo.IndexedDialog.static.title = 'Indexed dialog';
6 Demo.IndexedDialog.static.actions = [
7 { action: 'save', label: 'Done', flags: [ 'primary', 'progressive' ] },
8 { action: 'cancel', label: 'Cancel', flags: [ 'safe', 'back' ] }
10 Demo.IndexedDialog.prototype.getBodyHeight = function () {
13 Demo.IndexedDialog.prototype.initialize = function () {
14 Demo.IndexedDialog.parent.prototype.initialize.apply( this, arguments );
15 this.indexLayout = new OO.ui.IndexLayout();
17 new Demo.SampleTabPanel( 'first', { label: 'One' } ),
18 new Demo.SampleTabPanel( 'second', { label: 'Two' } ),
19 new Demo.SampleTabPanel( 'third', { label: 'Three' } ),
20 new Demo.SampleTabPanel( 'fourth', { label: 'Four' } )
23 this.indexLayout.addTabPanels( this.tabPanels );
24 this.$body.append( this.indexLayout.$element );
26 this.indexLayout.getTabs().getItemFromData( 'fourth' ).setDisabled( true );
28 Demo.IndexedDialog.prototype.getActionProcess = function ( action ) {
30 return new OO.ui.Process( function () {
31 this.close( { action: action } );
34 return Demo.IndexedDialog.parent.prototype.getActionProcess.call( this, action );