stickytoolbarview.js 730 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console:false */
  6. import testUtils from '../../../tests/_utils/utils';
  7. import StickyToolbarView from '../../../src/toolbar/sticky/stickytoolbarview';
  8. import '@ckeditor/ckeditor5-theme-lark/theme/theme.scss';
  9. testUtils.createTestUIView( {
  10. top: '.ck-editor__top'
  11. } )
  12. .then( ui => {
  13. createToolbar( ui.top );
  14. } )
  15. .catch( err => {
  16. console.error( err.stack );
  17. } );
  18. function createToolbar( collection ) {
  19. const toolbar = new StickyToolbarView();
  20. toolbar.limiterElement = collection._parentElement.parentNode;
  21. collection.add( toolbar ).then( () => {
  22. toolbar.isActive = true;
  23. } );
  24. }