]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - vendor/oojs/oojs-ui/demos/classes/ProcessDialog.js
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / oojs / oojs-ui / demos / classes / ProcessDialog.js
diff --git a/vendor/oojs/oojs-ui/demos/classes/ProcessDialog.js b/vendor/oojs/oojs-ui/demos/classes/ProcessDialog.js
new file mode 100644 (file)
index 0000000..c0f3d6c
--- /dev/null
@@ -0,0 +1,28 @@
+Demo.ProcessDialog = function DemoProcessDialog( config ) {
+       Demo.ProcessDialog.parent.call( this, config );
+};
+OO.inheritClass( Demo.ProcessDialog, OO.ui.ProcessDialog );
+Demo.ProcessDialog.static.title = 'Process dialog';
+Demo.ProcessDialog.static.actions = [
+       { action: 'save', label: 'Done', flags: [ 'primary', 'progressive' ] },
+       { action: 'cancel', label: 'Cancel', flags: [ 'safe', 'back' ] },
+       { action: 'other', label: 'Other', flags: 'other' }
+];
+Demo.ProcessDialog.prototype.initialize = function () {
+       Demo.ProcessDialog.parent.prototype.initialize.apply( this, arguments );
+       this.content = new OO.ui.PanelLayout( { padded: true, expanded: false } );
+       this.content.$element.append( '<p>Dialog content</p>' );
+       this.$body.append( this.content.$element );
+};
+Demo.ProcessDialog.prototype.getActionProcess = function ( action ) {
+       var dialog = this;
+       if ( action ) {
+               return new OO.ui.Process( function () {
+                       dialog.close( { action: action } );
+               } );
+       }
+       return Demo.ProcessDialog.parent.prototype.getActionProcess.call( this, action );
+};
+Demo.ProcessDialog.prototype.getBodyHeight = function () {
+       return this.content.$element.outerHeight( true );
+};