|
|
@@ -0,0 +1,21 @@
|
|
|
+/**
|
|
|
+ * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
|
|
|
+ * For licensing, see LICENSE.md.
|
|
|
+ */
|
|
|
+
|
|
|
+/* globals window, document */
|
|
|
+
|
|
|
+/**
|
|
|
+ * Returns the `config.toolbar.viewportTopOffset` config value for editors using floating toolbars that
|
|
|
+ * stick to the top of the viewport to remain visible to the user.
|
|
|
+ *
|
|
|
+ * The value is determined in styles by the `--ck-snippet-viewport-top-offset` custom property
|
|
|
+ * and may differ e.g. according to the used media queries.
|
|
|
+ *
|
|
|
+ * @returns {Number} The value of the offset.
|
|
|
+ */
|
|
|
+window.getViewportTopOffsetConfig = function() {
|
|
|
+ const documentElement = document.documentElement;
|
|
|
+
|
|
|
+ return parseInt( window.getComputedStyle( documentElement ).getPropertyValue( '--ck-snippet-viewport-top-offset' ) );
|
|
|
+};
|