]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - vendor/oojs/oojs-ui/demos/classes/LongProcessDialog.js
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / oojs / oojs-ui / demos / classes / LongProcessDialog.js
1 Demo.LongProcessDialog = function DemoLongProcessDialog( config ) {
2         Demo.LongProcessDialog.parent.call( this, config );
3 };
4 OO.inheritClass( Demo.LongProcessDialog, OO.ui.ProcessDialog );
5 Demo.LongProcessDialog.static.title = 'Process dialog';
6 Demo.LongProcessDialog.static.actions = [
7         { action: 'save', label: 'Done', flags: [ 'primary', 'progressive' ] },
8         { action: 'cancel', label: 'Cancel', flags: [ 'safe', 'back' ] },
9         { action: 'other', label: 'Other', flags: 'other' }
10 ];
11 Demo.LongProcessDialog.prototype.initialize = function () {
12         var i;
13
14         Demo.LongProcessDialog.parent.prototype.initialize.apply( this, arguments );
15         this.content = new OO.ui.PanelLayout( { padded: true, expanded: false } );
16         for ( i = 0; i < 100; i++ ) {
17                 this.content.$element.append( '<p>Dialog content</p>' );
18         }
19         this.$body.append( this.content.$element );
20 };
21 Demo.LongProcessDialog.prototype.getActionProcess = function ( action ) {
22         var dialog = this;
23         if ( action ) {
24                 return new OO.ui.Process( function () {
25                         dialog.close( { action: action } );
26                 } );
27         }
28         return Demo.LongProcessDialog.parent.prototype.getActionProcess.call( this, action );
29 };
30 Demo.LongProcessDialog.prototype.getBodyHeight = function () {
31         return this.content.$element.outerHeight( true );
32 };