Ticket #4542: 4542.patch
File 4542.patch, 2.8 KB (added by , 14 years ago) |
---|
-
_source/plugins/dialog/plugin.js
278 278 focusList[ currentIndex ].select(); 279 279 } 280 280 281 var processed; 282 281 283 function focusKeydownHandler( evt ) 282 284 { 283 285 // If I'm not the top dialog, ignore. 284 286 if ( me != CKEDITOR.dialog._.currentTop ) 285 287 return; 286 288 287 var keystroke = evt.data.getKeystroke(), 288 processed = false; 289 var keystroke = evt.data.getKeystroke(); 290 291 processed = 0; 289 292 if ( keystroke == 9 || keystroke == CKEDITOR.SHIFT + 9 ) 290 293 { 291 294 var shiftPressed = ( keystroke == CKEDITOR.SHIFT + 9 ); … … 304 307 changeFocus( !shiftPressed ); 305 308 } 306 309 307 processed = true;310 processed = 1; 308 311 } 309 312 else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode ) 310 313 { 311 314 // Alt-F10 puts focus into the current tab item in the tab bar. 312 315 me._.tabBarMode = true; 313 316 me._.tabs[ me._.currentTabId ][ 0 ].focus(); 314 processed = true;317 processed = 1; 315 318 } 316 319 else if ( ( keystroke == 37 || keystroke == 39 ) && me._.tabBarMode ) 317 320 { … … 319 322 nextId = ( keystroke == 37 ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me ) ); 320 323 me.selectPage( nextId ); 321 324 me._.tabs[ nextId ][ 0 ].focus(); 322 processed = true;325 processed = 1; 323 326 } 324 327 325 328 if ( processed ) … … 329 332 } 330 333 } 331 334 335 function focusKeyPressHandler( evt ) 336 { 337 processed && evt.data.preventDefault(); 338 } 339 332 340 // Add the dialog keyboard handlers. 333 341 this.on( 'show', function() 334 342 { 335 343 CKEDITOR.document.on( 'keydown', focusKeydownHandler, this, null, 0 ); 344 // Some browsers instead, don't cancel key events in the keydown, but in the 345 // keypress. So we must do a longer trip in those cases. (#4531) 346 if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) ) 347 CKEDITOR.document.on( 'keypress', focusKeyPressHandler, this ); 336 348 337 349 if ( CKEDITOR.env.ie6Compat ) 338 350 { … … 2448 2460 */ 2449 2461 isVisible : function() 2450 2462 { 2451 return !!this.getInputElement().$.offsetHeight; 2463 var element = this.getInputElement(), 2464 elementWindow = element.getWindow(), 2465 elementFrame, 2466 isVisible = !!element.$.offsetHeight; 2467 2468 // Webkit and Opera report non-zero offsetHeight despite that 2469 // element is inside an invisible iframe. (#4542) 2470 if( isVisible && ( CKEDITOR.env.webkit || CKEDITOR.env.opera ) 2471 && !elementWindow.equals( CKEDITOR.document.getWindow() ) 2472 && ( elementFrame = elementWindow.$.frameElement ) ) 2473 isVisible = !!elementFrame.offsetHeight; 2474 2475 return isVisible; 2452 2476 }, 2453 2477 2454 2478 /**