Changeset 29126
- Timestamp:
- 07/12/2014 10:50:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r29049 r29126 13 13 14 14 function getView( node ) { 15 // Doing this directly is about 40% faster 15 return getParent( node, 'wpview-wrap' ); 16 } 17 18 /** 19 * Returns the node or a parent of the node that has the passed className. 20 * Doing this directly is about 40% faster 21 */ 22 function getParent( node, className ) { 16 23 while ( node && node.parentNode ) { 17 if ( node.className && (' ' + node.className + ' ').indexOf(' wpview-wrap') !== -1 ) {24 if ( node.className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1 ) { 18 25 return node; 19 26 } … … 624 631 // If the cursor lands anywhere else in the view, set the cursor before it. 625 632 // Only try this once to prevent a loop. (You never know.) 626 } else if ( className !== 'wpview-clipboard'&& ! setViewCursorTries ) {633 } else if ( ! getParent( event.element, 'wpview-body' ) && ! setViewCursorTries ) { 627 634 deselect(); 628 635 setViewCursorTries++;
Note: See TracChangeset
for help on using the changeset viewer.