~canonical-sysadmins/wordpress/4.2.4

« back to all changes in this revision

Viewing changes to wp-admin/js/editor-expand.js

  • Committer: Paul Gear
  • Date: 2015-04-24 01:35:20 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: paul.gear@canonical.com-20150424013520-w4p9ksth76zh6opw
Merge new upstream release 4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
                                var node = editor.selection.getNode(),
178
178
                                        range, view, offset;
179
179
 
180
 
                                if ( editor.plugins.wpview && ( view = editor.plugins.wpview.getView( node ) ) ) {
 
180
                                if ( editor.wp && editor.wp.getView && ( view = editor.wp.getView( node ) ) ) {
181
181
                                        offset = view.getBoundingClientRect();
182
182
                                } else {
183
183
                                        range = editor.selection.getRng();
323
323
                        var windowPos = $window.scrollTop(),
324
324
                                type = event && event.type,
325
325
                                resize = type !== 'scroll',
326
 
                                visual = ( mceEditor && ! mceEditor.isHidden() ),
 
326
                                visual = mceEditor && ! mceEditor.isHidden(),
327
327
                                buffer = autoresizeMinHeight,
328
328
                                postBodyTop = $postBody.offset().top,
329
329
                                borderWidth = 1,
350
350
                                topHeight = heights.textTopHeight;
351
351
                        }
352
352
 
 
353
                        // TinyMCE still intializing.
 
354
                        if ( ! visual && ! $top.length ) {
 
355
                                return;
 
356
                        }
 
357
 
353
358
                        topPos = $top.parent().offset().top;
354
359
                        editorPos = $editor.offset().top;
355
360
                        editorHeight = $editor.outerHeight();
380
385
                                                width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
381
386
                                        } );
382
387
 
383
 
                                        $statusBar.add( $bottom ).attr( 'style', '' );
 
388
                                        $statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' );
 
389
                                        $bottom.attr( 'style', '' );
384
390
                                }
385
391
                        } else {
386
392
                                // Maybe pin the top.
489
495
                                                ( windowPos + heights.windowHeight ) > ( editorPos + editorHeight + heights.bottomHeight + heights.statusBarHeight - borderWidth ) ) ) {
490
496
                                        fixedBottom = false;
491
497
 
492
 
                                        $statusBar.add( $bottom ).attr( 'style', '' );
493
 
 
494
 
                                        if ( ! advanced ) {
495
 
                                                $statusBar.css( 'visibility', 'hidden' );
496
 
                                        }
 
498
                                        $statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' );
 
499
                                        $bottom.attr( 'style', '' );
497
500
                                }
498
501
                        }
499
502
 
682
685
                }
683
686
 
684
687
                function off() {
685
 
                        var height = window.getUserSetting('ed_size');
 
688
                        var height = parseInt( window.getUserSetting( 'ed_size', 300 ), 10 );
 
689
 
 
690
                        if ( height < 50 ) {
 
691
                                height = 50;
 
692
                        } else if ( height > 5000 ) {
 
693
                                height = 5000;
 
694
                        }
686
695
 
687
696
                        // Scroll to the top when triggering this from JS.
688
697
                        // Ensures toolbars are reset properly.