1 Demo.OutlinedBookletDialog = function DemoOutlinedBookletDialog( config ) {
2 Demo.OutlinedBookletDialog.parent.call( this, config );
4 OO.inheritClass( Demo.OutlinedBookletDialog, OO.ui.ProcessDialog );
5 Demo.OutlinedBookletDialog.static.title = 'Outlined booklet dialog';
6 Demo.OutlinedBookletDialog.static.actions = [
7 { action: 'save', label: 'Done', flags: [ 'primary', 'progressive' ] },
8 { action: 'cancel', label: 'Cancel', flags: [ 'safe', 'back' ] }
10 Demo.OutlinedBookletDialog.prototype.getBodyHeight = function () {
13 Demo.OutlinedBookletDialog.prototype.initialize = function () {
14 Demo.OutlinedBookletDialog.parent.prototype.initialize.apply( this, arguments );
15 this.bookletLayout = new OO.ui.BookletLayout( {
19 new Demo.SamplePage( 'small', { label: 'Small', icon: 'window' } ),
20 new Demo.SamplePage( 'medium', { label: 'Medium', icon: 'window' } ),
21 new Demo.SamplePage( 'large', { label: 'Large', icon: 'window' } ),
22 new Demo.SamplePage( 'larger', { label: 'Larger', icon: 'window' } ),
23 new Demo.SamplePage( 'full', { label: 'Full', icon: 'window' } )
26 this.bookletLayout.addPages( this.pages );
27 this.bookletLayout.connect( this, { set: 'onBookletLayoutSet' } );
28 this.$body.append( this.bookletLayout.$element );
30 Demo.OutlinedBookletDialog.prototype.getActionProcess = function ( action ) {
32 return new OO.ui.Process( function () {
33 this.close( { action: action } );
36 return Demo.OutlinedBookletDialog.parent.prototype.getActionProcess.call( this, action );
38 Demo.OutlinedBookletDialog.prototype.onBookletLayoutSet = function ( page ) {
39 this.setSize( page.getName() );
41 Demo.OutlinedBookletDialog.prototype.getSetupProcess = function ( data ) {
42 return Demo.OutlinedBookletDialog.parent.prototype.getSetupProcess.call( this, data )
44 this.bookletLayout.setPage( this.getSize() );