| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
ve.init.sa.Target = function VeInitSaTarget( config ) { |
| 32 |
config = config || {}; |
| 33 |
config.toolbarConfig = ve.extendObject( { shadow: true, floatable: true }, config.toolbarConfig ); |
| 34 |
|
| 35 |
|
| 36 |
ve.init.sa.Target.super.call( this, config ); |
| 37 |
|
| 38 |
this.$element |
| 39 |
.addClass( 've-init-sa-target' ) |
| 40 |
.attr( 'lang', ve.init.platform.getUserLanguages()[ 0 ] ); |
| 41 |
}; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
OO.inheritClass( ve.init.sa.Target, ve.init.Target ); |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
ve.init.sa.Target.prototype.addSurface = function () { |
| 54 |
|
| 55 |
const surface = ve.init.sa.Target.super.prototype.addSurface.apply( this, arguments ); |
| 56 |
|
| 57 |
this.$element.append( $( '<div>' ).addClass( 've-init-sa-target-surfaceWrapper' ).append( surface.$element ) ); |
| 58 |
if ( !this.getSurface() ) { |
| 59 |
this.setSurface( surface ); |
| 60 |
} |
| 61 |
surface.initialize(); |
| 62 |
this.emit( 'surfaceReady' ); |
| 63 |
return surface; |
| 64 |
}; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
ve.init.sa.Target.prototype.setupToolbar = function ( surface ) { |
| 70 |
|
| 71 |
ve.init.sa.Target.super.prototype.setupToolbar.call( this, surface ); |
| 72 |
|
| 73 |
this.getToolbar().$element.addClass( 've-init-sa-target-toolbar' ); |
| 74 |
}; |