Ticket #12424: opera-tab.12424.diff
| File opera-tab.12424.diff, 1.1 KB (added by , 16 years ago) |
|---|
-
wp-admin/js/common.dev.js
269 269 }); 270 270 271 271 // tab in textareas 272 $(' textarea#newcontent').keydown(function(e) {272 $('#newcontent').keydown(function(e) { 273 273 if ( e.keyCode != 9 ) 274 274 return true; 275 275 276 276 var el = e.target, selStart = el.selectionStart, selEnd = el.selectionEnd, val = el.value, scroll, sel; 277 277 278 e.stopPropagation(); 279 e.preventDefault(); 278 try { 279 this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below. 280 } catch(err) {} 280 281 281 282 if ( document.selection ) { 282 283 el.focus(); … … 288 289 el.selectionStart = el.selectionEnd = selStart + 1; 289 290 this.scrollTop = scroll; 290 291 } 292 293 if ( e.stopPropagation ) 294 e.stopPropagation(); 295 if ( e.preventDefault ) 296 e.preventDefault(); 291 297 }); 298 299 $('#newcontent').blur(function(e) { 300 if ( this.lastKey && 9 == this.lastKey ) 301 this.focus(); 302 }); 292 303 }); 293 304 294 305 jQuery(document).ready( function($){