stickypanelview.js 846 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 '../../../_utils/utils';
  6. import StickyPanelView from '../../../../src/panel/sticky/stickypanelview';
  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. createStickyPanel( ui.stickyToTheTop );
  13. const stickyToTheBoxTPanel = createStickyPanel( ui.stickyToTheBox );
  14. stickyToTheBoxTPanel.viewportTopOffset = 100;
  15. function createStickyPanel( collection ) {
  16. const panel = new StickyPanelView();
  17. panel.limiterElement = collection._parentElement.parentNode;
  18. collection.add( panel );
  19. panel.isActive = true;
  20. return panel;
  21. }