Merge "Fix behavior of Hooks class."
[lhc/web/wiklou.git] / resources / jquery / jquery.placeholder.js
index 5ec05f2..7badb11 100644 (file)
        $.fn.placeholder = function () {
 
                return this.each( function () {
+                       var placeholder, $input;
 
                        // If the HTML5 placeholder attribute is supported, use it
                        if ( this.placeholder && 'placeholder' in document.createElement( this.tagName ) ) {
                                return;
                        }
 
-                       var placeholder = this.getAttribute( 'placeholder' );
-                       var $input = $(this);
+                       placeholder = this.getAttribute( 'placeholder' );
+                       $input = $(this);
 
                        // Show initially, if empty
                        if ( this.value === '' || this.value === placeholder ) {
@@ -39,7 +40,7 @@
                                // Hide on focus
                                // Also listen for other events in case $input was
                                // already focused when the events were bound
-                               .bind( 'focus drop keydown paste', function ( e ) {
+                               .on( 'focus drop keydown paste', function ( e ) {
                                        if ( $input.hasClass( 'placeholder' ) ) {
                                                if ( e.type === 'drop' && e.originalEvent.dataTransfer ) {
                                                        // Support for drag&drop. Instead of inserting the dropped