Changeset 29298
- Timestamp:
- 07/25/2014 12:55:33 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r29273 r29298 116 116 117 117 // Bail if node is already selected. 118 if ( viewNode === selected ) {118 if ( ! viewNode || viewNode === selected ) { 119 119 return; 120 120 } … … 296 296 event.stopPropagation(); 297 297 298 // Hack to try and keep the block resize handles from appearing. They will show on mousedown and then be removed on mouseup. 299 if ( Env.ie <= 10 ) { 300 deselect(); 301 } 302 303 select( view ); 304 305 if ( event.type === 'click' && ! event.metaKey && ! event.ctrlKey ) { 298 if ( event.type === 'mousedown' && ! event.metaKey && ! event.ctrlKey ) { 306 299 if ( editor.dom.hasClass( event.target, 'edit' ) ) { 307 300 wp.mce.views.edit( view ); 301 editor.focus(); 302 return false; 308 303 } else if ( editor.dom.hasClass( event.target, 'remove' ) ) { 309 304 removeView( view ); 310 } 311 } 305 return false; 306 } 307 } 308 309 select( view ); 312 310 313 311 // Returning false stops the ugly bars from appearing in IE11 and stops the view being selected as a range in FF. … … 315 313 return false; 316 314 } else { 317 // Fix issue with deselecting a view in IE8. Without this hack, clicking content above the view wouldn't actually deselect it 318 // and the caret wouldn't be placed at the mouse location 319 if ( Env.ie && Env.ie <= 8 ) { 320 deselectEventType = 'mouseup'; 321 } else { 322 deselectEventType = 'mousedown'; 323 } 324 325 if ( event.type === deselectEventType ) { 315 if ( event.type === 'mousedown' ) { 326 316 deselect(); 327 317 }
Note: See TracChangeset
for help on using the changeset viewer.