| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
ve.ui.MWFloatingHelpDialog = function VeUiMWFloatingHelpDialog( config ) { |
| 20 |
|
| 21 |
ve.ui.MWFloatingHelpDialog.super.call( this, config ); |
| 22 |
|
| 23 |
this.label = config.label; |
| 24 |
this.$message = config.$message; |
| 25 |
}; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
OO.inheritClass( ve.ui.MWFloatingHelpDialog, OO.ui.ProcessDialog ); |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
ve.ui.MWFloatingHelpDialog.static.name = 'floatingHelp'; |
| 34 |
|
| 35 |
ve.ui.MWFloatingHelpDialog.static.actions = [ |
| 36 |
{ |
| 37 |
label: OO.ui.deferMsg( 'visualeditor-dialog-action-cancel' ), |
| 38 |
flags: [ 'safe', 'close' ] |
| 39 |
} |
| 40 |
]; |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
ve.ui.MWFloatingHelpDialog.prototype.initialize = function () { |
| 48 |
ve.ui.MWFloatingHelpDialog.super.prototype.initialize.call( this ); |
| 49 |
const content = new OO.ui.PanelLayout( { padded: true, expanded: false } ); |
| 50 |
content.$element.append( this.$message ); |
| 51 |
this.$body.append( content.$element ); |
| 52 |
this.$foot.remove(); |
| 53 |
}; |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
ve.ui.MWFloatingHelpDialog.prototype.getSetupProcess = function ( data ) { |
| 59 |
return ve.ui.MWFloatingHelpDialog.super.prototype.getSetupProcess.call( this, data ).next( () => { |
| 60 |
this.title.setLabel( this.label ); |
| 61 |
} ); |
| 62 |
}; |
| 63 |
|
| 64 |
ve.ui.MWFloatingHelpDialog.prototype.getSizeProperties = function () { |
| 65 |
const sizeProps = ve.ui.MWFloatingHelpDialog.super.prototype.getSizeProperties.call( this ); |
| 66 |
if ( !OO.ui.isMobile() ) { |
| 67 |
return ve.extendObject( {}, sizeProps, { width: '350px', maxHeight: '50%' } ); |
| 68 |
} |
| 69 |
return sizeProps; |
| 70 |
}; |