| 452 | | mceIframe, mceToolbar, mceStatusbar, wpStatusbar; |
| 453 | | |
| 454 | | editor.on( 'init', function() { |
| 455 | | mceIframe = document.getElementById( editor.id + '_ifr' ); |
| 456 | | mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0]; |
| 457 | | mceStatusbar = tinymce.$( '.mce-statusbar', editor.getContainer() )[0]; |
| | 453 | mceIframe = document.getElementById( editor.id + '_ifr' ), |
| | 454 | mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0], |
| | 455 | mceStatusbar = tinymce.$( '.mce-statusbar', editor.getContainer() )[0], |
| | 456 | wpStatusbar; |
| 680 | | toolbar.on( 'remove', function() { |
| 681 | | DOM.unbind( window, 'resize scroll', hide ); |
| 682 | | editor.dom.unbind( editor.getWin(), 'resize scroll', hide ); |
| 683 | | editor.off( 'blur hide', hide ); |
| 684 | | } ); |
| 685 | | |
| 686 | | editor.once( 'init', function() { |
| 687 | | DOM.bind( window, 'resize scroll', hide ); |
| 688 | | editor.dom.bind( editor.getWin(), 'resize scroll', hide ); |
| 689 | | editor.on( 'blur hide', hide ); |
| 690 | | } ); |
| 691 | | |
| 738 | | editor.on( 'hide', function() { |
| 739 | | activeToolbar = false; |
| 740 | | } ); |
| | 720 | function hide( event ) { |
| | 721 | if ( activeToolbar ) { |
| | 722 | activeToolbar.hide(); |
| | 723 | |
| | 724 | if ( event.type === 'hide' ) { |
| | 725 | activeToolbar = false; |
| | 726 | } else if ( event.type === 'resize' || event.type === 'scroll' ) { |
| | 727 | clearTimeout( timeout ); |
| | 728 | |
| | 729 | timeout = setTimeout( function() { |
| | 730 | activeToolbar.show(); |
| | 731 | }, 250 ); |
| | 732 | } |
| | 733 | } |
| | 734 | } |
| | 735 | |
| | 736 | DOM.bind( window, 'resize scroll', hide ); |
| | 737 | editor.dom.bind( editor.getWin(), 'resize scroll', hide ); |
| | 738 | editor.on( 'blur hide', hide ); |