File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ function showProsemirror(json) {
2222 const $prosemirrorJsonInput = jQuery ( '#dw__editform' ) . find ( '[name=prosemirror_json]' ) . val ( json ) ;
2323 try {
2424 window . Prosemirror . enableProsemirror ( ) ;
25+ stickyMenubar ( ) ;
2526 disableNativeFirefoxTableControls ( ) ;
2627 } catch ( e ) {
2728 console . error ( e ) ;
@@ -173,9 +174,10 @@ function handleEditSession() {
173174 * @see https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
174175 */
175176
176- function menubar ( ) {
177+ function stickyMenubar ( ) {
177178 const editorswitch = document . querySelector ( 'button[name=prosemirror]' ) ;
178179 const menubar = document . querySelector ( '#prosemirror__editor div.menubar' ) ;
180+
179181 const observer = new IntersectionObserver (
180182 ( [ e ] ) => {
181183 return menubar . classList . toggle ( 'prosemirror-menubar-fixed' , e . intersectionRatio !== 1 ) ;
@@ -195,8 +197,6 @@ jQuery(function () {
195197 initializeProsemirror ( ) ;
196198 window . proseMirrorIsActive = false ;
197199
198- jQuery ( menubar ) ;
199-
200200 if ( jQuery ( '#dw__editform' ) . find ( '[name=prosemirror_json]' ) . length ) {
201201 handleEditSession ( ) ;
202202 }
You can’t perform that action at this time.
0 commit comments