Menubar.Edit.js 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Menubar.Edit = function ( signals ) {
  2. var container = new UI.Panel();
  3. container.setClass( 'menu' );
  4. container.onMouseOver( function () { options.setDisplay( 'block' ) } );
  5. container.onMouseOut( function () { options.setDisplay( 'none' ) } );
  6. container.onClick( function () { options.setDisplay( 'none' ) } );
  7. var title = new UI.Panel();
  8. title.setTextContent( 'Edit' ).setColor( '#666' );
  9. title.setMargin( '0px' );
  10. title.setPadding( '8px' );
  11. container.add( title );
  12. //
  13. var options = new UI.Panel();
  14. options.setClass( 'options' );
  15. options.setDisplay( 'none' );
  16. container.add( options );
  17. // clone
  18. var option = new UI.Panel();
  19. option.setClass( 'option' );
  20. option.setTextContent( 'Clone' );
  21. option.onClick( function () {
  22. editor.clone();
  23. } );
  24. options.add( option );
  25. // delete
  26. var option = new UI.Panel();
  27. option.setClass( 'option' );
  28. option.setTextContent( 'Delete' );
  29. option.onClick( function () {
  30. editor.delete();
  31. } );
  32. options.add( option );
  33. //
  34. return container;
  35. }