balloonpanelview.js 775 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals document */
  6. import BalloonPanelView from '../../../../src/panel/balloon/balloonpanelview';
  7. import '@ckeditor/ckeditor5-theme-lark/theme/theme.scss';
  8. const defaultPositions = BalloonPanelView.defaultPositions;
  9. const container = document.querySelector( '#container' );
  10. for ( const i in defaultPositions ) {
  11. const target = document.createElement( 'div' );
  12. target.classList.add( 'target' );
  13. container.appendChild( target );
  14. const balloon = new BalloonPanelView();
  15. balloon.element.textContent = i;
  16. document.body.appendChild( balloon.element );
  17. balloon.attachTo( {
  18. target,
  19. positions: [
  20. defaultPositions[ i ]
  21. ]
  22. } );
  23. }