| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
ve.ui.SymbolListBookletLayout = function VeUiSymbolListBookletLayout( config ) { |
| 17 |
config = config || {}; |
| 18 |
|
| 19 |
|
| 20 |
ve.ui.SymbolListBookletLayout.super.call( this, ve.extendObject( { |
| 21 |
outlined: true, |
| 22 |
continuous: true |
| 23 |
}, config ) ); |
| 24 |
|
| 25 |
this.$element.addClass( 've-ui-symbolListBookletLayout' ); |
| 26 |
}; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
OO.inheritClass( ve.ui.SymbolListBookletLayout, OO.ui.BookletLayout ); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
ve.ui.SymbolListBookletLayout.prototype.setSymbolData = function ( symbolData ) { |
| 40 |
const pages = []; |
| 41 |
for ( const category in symbolData ) { |
| 42 |
pages.push( |
| 43 |
new ve.ui.SymbolListPage( category, symbolData[ category ] ) |
| 44 |
); |
| 45 |
} |
| 46 |
this.addPages( pages ); |
| 47 |
this.$element.on( |
| 48 |
'click', |
| 49 |
'.ve-ui-symbolListPage-symbol', |
| 50 |
this.onListClick.bind( this ) |
| 51 |
); |
| 52 |
}; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
ve.ui.SymbolListBookletLayout.prototype.onListClick = function ( e ) { |
| 60 |
const symbol = $( e.target ).data( 'symbol' ); |
| 61 |
|
| 62 |
if ( symbol ) { |
| 63 |
this.emit( 'choose', symbol ); |
| 64 |
} |
| 65 |
}; |