Index: trunk/phase3/resources/jquery/jquery.placeholder.js |
— | — | @@ -37,9 +37,16 @@ |
38 | 38 | } ) |
39 | 39 | |
40 | 40 | // Hide on focus |
41 | | - .focus( function() { |
| 41 | + // Also listen for other events in case $input was |
| 42 | + // already focused when the events were bound |
| 43 | + .bind( 'focus drop keydown paste', function( e ) { |
42 | 44 | if ( $input.hasClass( 'placeholder' ) ) { |
43 | | - this.value = ''; |
| 45 | + // Support for drag&drop in Firefox |
| 46 | + if ( e.type == 'drop' && e.originalEvent.dataTransfer ) { |
| 47 | + this.value = e.originalEvent.dataTransfer.getData( 'text/plain' ); |
| 48 | + } else { |
| 49 | + this.value = ''; |
| 50 | + } |
44 | 51 | $input.removeClass( 'placeholder' ); |
45 | 52 | } |
46 | 53 | } ); |
Index: trunk/extensions/Vector/modules/ext.vector.simpleSearch.js |
— | — | @@ -78,8 +78,9 @@ |
79 | 79 | positionFromLeft: $( 'body' ).is( '.rtl' ), |
80 | 80 | highlightInput: true |
81 | 81 | } ) |
82 | | - .bind( 'paste cut', function( e ) { |
83 | | - // make sure paste and cut events from the mouse trigger the keypress handler and cause the suggestions to update |
| 82 | + .bind( 'paste cut drop', function( e ) { |
| 83 | + // make sure paste and cut events from the mouse and drag&drop events |
| 84 | + // trigger the keypress handler and cause the suggestions to update |
84 | 85 | $( this ).trigger( 'keypress' ); |
85 | 86 | } ); |
86 | 87 | // Special suggestions functionality for skin-provided search box |