Commits

Germano Gabbianelli committed 43e942b

Cleaned the js a bit with JSLint.

  • Participants
  • Parent commits 6851e0d

Comments (0)

Files changed (1)

autocomplete/media/js/jquery_autocomplete.js

                 .data( "item.autocomplete", item )
                 .append( $( "<a></a>" ).append( item.label ) )
                 .appendTo( ul );
-        },
+        }
 
     },
     _create: function() {
                     }
                     return false;
                 }
-            },
+            }
         }).data( "autocomplete" )._renderItem = this.options.renderItem;
         this._initSource();
         if ( this.options.multiple ) {
         } else {
             this.lastSelected = {
                 id: this.hidden_input.val(),
-                value: this.element.val(),
+                value: this.element.val()
             };
         }
         if (this.options.force_selection) {
     
     destroy: function() {
         this.element.autocomplete( "destroy" );
-        if ( this.options.multiple ) this.values_ul.remove();
+        if ( this.options.multiple ) {
+            this.values_ul.remove();
+        }
 		$.Widget.prototype.destroy.call( this );
     },
 
         this.values = [];
         if ( this.hidden_input.val() !== "" ) {
             $.each(this.hidden_input.val().split( "," ), function(i, id) {
-                self.values.push( parseInt(id) );
+                self.values.push( parseInt(id, 10) );
             });
         }
         this.values_ul = this.element.nextAll( "ul.ui-autocomplete-values" );
             var span = $(this).parent();
             var id = span.data( "value.autocomplete" );
             $.each( self.values, function (i, v) {
-                if (v === id) self.values.splice(i, 1);
+                if (v === id) {
+                    self.values.splice(i, 1);
+                }
             });
             span.remove();
         });
-    },
+    }
 });
 
 
 django.autocomplete = function (id, options) {
     return $(id).djangoautocomplete(options);
-}
+};
 
 window.django = django;