| 262 | // Gecko/Webkit need some help when selecting control type elements. (#3448) |
| 263 | if ( !( CKEDITOR.env.ie || CKEDITOR.env.opera) ) |
| 264 | { |
| 265 | domDocument.on( 'mousedown', function( ev ) |
| 266 | { |
| 267 | var control = ev.data.getTarget(); |
| 268 | if ( control.is( 'img', 'hr', 'input', 'textarea', 'select' ) ) |
| 269 | editor.getSelection().selectElement( control ); |
| 270 | } ); |
| 271 | } |
| 272 | |
| 273 | // Webkit: avoid from editing form control elements content. |
| 274 | if ( CKEDITOR.env.webkit ) |
| 275 | { |
| 276 | // Prevent from tick checkbox/radiobox/select |
| 277 | domDocument.on( 'click', function( ev ) |
| 278 | { |
| 279 | if ( ev.data.getTarget().is( 'input', 'select' ) ) |
| 280 | ev.data.preventDefault(); |
| 281 | } ); |
| 282 | |
| 283 | // Prevent from editig textfield/textarea value. |
| 284 | domDocument.on( 'mouseup', function( ev ) |
| 285 | { |
| 286 | if ( ev.data.getTarget().is( 'input', 'textarea' ) ) |
| 287 | ev.data.preventDefault(); |
| 288 | } ); |
| 289 | } |
| 290 | |