13 989
edycji
(UWAGA! Usunięcie treści (strona pozostała pusta)!) Znaczniki: Ręczne wycofanie zmian Usunięcie całej zawartości strony |
Znacznik: Wycofane |
||
| Linia 1: | Linia 1: | ||
// Example of a menu layout. | |||
var | |||
menuLayout = new OO.ui.MenuLayout( { | |||
menuPosition: 'top' | |||
} ), | |||
menuPanel = new OO.ui.PanelLayout( { padded: true, expanded: true, scrollable: true } ), | |||
contentPanel = new OO.ui.PanelLayout( { padded: true, expanded: true, scrollable: true } ), | |||
select = new OO.ui.SelectWidget( { | |||
items: [ | |||
new OO.ui.OptionWidget( { | |||
data: 'before', | |||
label: 'Before', | |||
} ), | |||
new OO.ui.OptionWidget( { | |||
data: 'after', | |||
label: 'After', | |||
} ), | |||
new OO.ui.OptionWidget( { | |||
data: 'top', | |||
label: 'Top', | |||
} ), | |||
new OO.ui.OptionWidget( { | |||
data: 'bottom', | |||
label: 'Bottom', | |||
} ) | |||
] | |||
} ).on( 'select', function ( item ) { | |||
menuLayout.setMenuPosition( item.getData() ); | |||
} ); | |||
menuLayout.$menu.append( | |||
menuPanel.$element.append( '<b>Menu panel</b>', select.$element ) | |||
); | |||
menuLayout.$content.append( | |||
contentPanel.$element.append( '<b>Content panel</b>', '<p>Note that the menu is positioned relative to the content panel: top, bottom, after, before.</p>') | |||
); | |||
$( document.body ).append( menuLayout.$element ); | |||