balloonpanelview.js 794 B

123456789101112131415161718192021222324252627282930
  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.render();
  16. balloon.element.textContent = i;
  17. document.body.appendChild( balloon.element );
  18. balloon.attachTo( {
  19. target,
  20. positions: [
  21. defaultPositions[ i ]
  22. ]
  23. } );
  24. }