WordPress.org

Make WordPress Core

Changeset 5603


Ignore:
Timestamp:
05/31/2007 01:31:04 AM (11 years ago)
Author:
rob1n
Message:

Check that tinyMCE is defined. Props johnbillion. fixes #4257 for 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-includes/general-template.php

    r5526 r5603  
    900900    edCanvas = document.getElementById('<?php echo $id; ?>');
    901901    <?php if ( $prev_id && user_can_richedit() ) : ?>
     902    // If tinyMCE is defined.
     903    if ( typeof tinyMCE != 'undefined' ) {
    902904    // This code is meant to allow tabbing from Title to Post (TinyMCE).
    903     if ( tinyMCE.isMSIE )
    904         document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e)
    905             {
     905        if ( tinyMCE.isMSIE ) {
     906            document.getElementById('<?php echo $prev_id; ?>').onkeydown = function (e) {
    906907                e = e ? e : window.event;
    907908                if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
     
    916917                }
    917918            }
    918     else
    919         document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e)
    920             {
     919        } else {
     920            document.getElementById('<?php echo $prev_id; ?>').onkeypress = function (e) {
    921921                e = e ? e : window.event;
    922922                if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
     
    931931                }
    932932            }
     933        }
     934    }
    933935    <?php endif; ?>
    934936    //-->
Note: See TracChangeset for help on using the changeset viewer.