stickytoolbarview.js 857 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import testUtils from '../../../tests/_utils/utils';
  6. import StickyToolbarView from '../../../src/toolbar/sticky/stickytoolbarview';
  7. import '@ckeditor/ckeditor5-theme-lark/theme/theme.scss';
  8. const ui = testUtils.createTestUIView( {
  9. stickyToTheTop: '.ck-sticky_to-the-top .ck-editor__top',
  10. stickyToTheBox: '.ck-sticky_to-the-box .ck-editor__top'
  11. } );
  12. createToolbar( ui.stickyToTheTop );
  13. const stickyToTheBoxToolbar = createToolbar( ui.stickyToTheBox );
  14. stickyToTheBoxToolbar.viewportTopOffset = 100;
  15. function createToolbar( collection ) {
  16. const toolbar = new StickyToolbarView();
  17. toolbar.limiterElement = collection._parentElement.parentNode;
  18. collection.add( toolbar );
  19. toolbar.isActive = true;
  20. return toolbar;
  21. }