stickypanelview.js 787 B

12345678910111213141516171819202122232425262728
  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. const ui = testUtils.createTestUIView( {
  8. stickyToTheTop: '.ck-sticky_to-the-top .ck-editor__top',
  9. stickyToTheBox: '.ck-sticky_to-the-box .ck-editor__top'
  10. } );
  11. createStickyPanel( ui.stickyToTheTop );
  12. const stickyToTheBoxTPanel = createStickyPanel( ui.stickyToTheBox );
  13. stickyToTheBoxTPanel.viewportTopOffset = 100;
  14. function createStickyPanel( collection ) {
  15. const panel = new StickyPanelView();
  16. panel.limiterElement = collection._parentElement.parentNode;
  17. collection.add( panel );
  18. panel.isActive = true;
  19. return panel;
  20. }