| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
ve.ui.ToolbarDialog = function VeUiToolbarDialog( config ) { |
| 18 |
|
| 19 |
ve.ui.ToolbarDialog.super.call( this, config ); |
| 20 |
|
| 21 |
|
| 22 |
this.disabled = false; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
this.$element.addClass( 've-ui-toolbarDialog' ); |
| 28 |
}; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
OO.inheritClass( ve.ui.ToolbarDialog, OO.ui.Dialog ); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
ve.ui.ToolbarDialog.static.size = 'full'; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
ve.ui.ToolbarDialog.static.padded = true; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
ve.ui.ToolbarDialog.static.framed = true; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
ve.ui.ToolbarDialog.static.position = 'above'; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
ve.ui.ToolbarDialog.prototype.initialize = function () { |
| 69 |
|
| 70 |
ve.ui.ToolbarDialog.super.prototype.initialize.call( this ); |
| 71 |
|
| 72 |
this.$content.addClass( 've-ui-toolbarDialog-content' ); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
this.$element.addClass( 've-ui-toolbarDialog-position-' + this.constructor.static.position ); |
| 79 |
if ( this.constructor.static.padded ) { |
| 80 |
this.$element.addClass( 've-ui-toolbarDialog-padded' ); |
| 81 |
} |
| 82 |
if ( this.constructor.static.framed ) { |
| 83 |
this.$element.addClass( 've-ui-toolbarDialog-framed' ); |
| 84 |
} |
| 85 |
|
| 86 |
this.title.setInvisibleLabel( true ); |
| 87 |
this.$element.prepend( this.title.$element ); |
| 88 |
}; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
ve.ui.ToolbarDialog.prototype.setDisabled = function ( disabled ) { |
| 96 |
this.$content.addClass( 've-ui-toolbarDialog-content' ); |
| 97 |
if ( disabled !== this.disabled ) { |
| 98 |
this.disabled = disabled; |
| 99 |
this.$body.toggleClass( 've-ui-toolbarDialog-disabled', this.disabled ); |
| 100 |
} |
| 101 |
}; |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
ve.ui.ToolbarDialog.prototype.getTeardownProcess = function ( data ) { |
| 107 |
ve.track( 'activity.' + this.constructor.static.name, { action: 'dialog-' + ( data && data.action || 'abort' ) } ); |
| 108 |
return ve.ui.ToolbarDialog.super.prototype.getTeardownProcess.apply( this, arguments ); |
| 109 |
}; |