ui.editor.js 844 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. UI.MenubarHelper = {
  2. createMenuContainer: function ( name, optionsPanel ) {
  3. var container = new UI.Panel();
  4. var title = new UI.Panel();
  5. title.setTextContent( name );
  6. title.setMargin( '0px' );
  7. title.setPadding( '8px' );
  8. container.setClass( 'menu' );
  9. container.add( title );
  10. container.add( optionsPanel );
  11. return container;
  12. },
  13. createOption: function ( name, callbackHandler ) {
  14. var option = new UI.Panel();
  15. option.setClass( 'option' );
  16. option.setTextContent( name );
  17. option.onClick( callbackHandler );
  18. return option;
  19. },
  20. createOptionsPanel: function ( menuConfig ) {
  21. var options = new UI.Panel();
  22. options.setClass( 'options' );
  23. menuConfig.forEach(function(option) {
  24. options.add(option);
  25. });
  26. return options;
  27. },
  28. createDivider: function () {
  29. return new UI.HorizontalRule();
  30. }
  31. };